MCPcopy
hub / github.com/cilium/cilium / TLSServerName

Function TLSServerName

pkg/hubble/peer/handler.go:179–197  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

177// defaults to the default cluster name. All Dot (.) in clusterName are
178// replaced by Hypen (-).
179func 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}

Callers 2

NewFunction · 0.92
newChangeNotificationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…