TLSServerName constructs a server name to be used as the TLS server name. The server name is of the following form: . . . For example, with nodeName=moseisley and clusterName=tatooine, the following server name is returned: moseisley.tatooine.h
(nodeName, clusterName string)
| 177 | // defaults to the default cluster name. All Dot (.) in clusterName are |
| 178 | // replaced by Hypen (-). |
| 179 | func TLSServerName(nodeName, clusterName string) string { |
| 180 | if nodeName == "" { |
| 181 | return "" |
| 182 | } |
| 183 | // To ensure that each node's ServerName is at the same DNS domain level, |
| 184 | // we have to lookout for Dot (.) as Kubernetes allows them in Node names. |
| 185 | nn := strings.ReplaceAll(nodeName, ".", "-") |
| 186 | if clusterName == "" { |
| 187 | clusterName = ciliumDefaults.ClusterName |
| 188 | } |
| 189 | // The cluster name may also contain dots. |
| 190 | cn := strings.ReplaceAll(clusterName, ".", "-") |
| 191 | return strings.Join([]string{ |
| 192 | nn, |
| 193 | cn, |
| 194 | defaults.GRPCServiceName, |
| 195 | defaults.DomainName, |
| 196 | }, ".") |
| 197 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…