Skip to content

Commit

Permalink
tweak function name
Browse files Browse the repository at this point in the history
  • Loading branch information
whalecold committed Dec 28, 2023
1 parent c12b7aa commit a417fa0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/manager/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ func nodeId(podIP, podName, namespace, nodeDomain string) string {
return fmt.Sprintf("sidecar~%s~%s.%s~%s.svc.%s", podIP, podName, namespace, namespace, nodeDomain)
}

// tryFQDN try expand fully qualified domain name.
func (bc *BootstrapConfig) tryFQDN(host string) string {
// tryExpandFQDN try expand fully qualified domain name.
func (bc *BootstrapConfig) tryExpandFQDN(host string) string {
// The kubernetes services following the <serviceName>.<ns>.svc.<suffix> naming convention
// and that share a suffix with the domain. If it already been expanded, ignore it.
if strings.Contains(host, ".svc.") {
Expand Down
2 changes: 1 addition & 1 deletion core/manager/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func (c *xdsClient) resolveAddr(host string) string {
// 2. short name in Kubernetes, such as example, invoke once when the host exists in cipResolver, and twice when the host does not exist in cipResolver.
// 3. service outside Kubernetes, such as www.example.com, invoke twice always.
// FIXME: format as <serviceName>.<namespace> is not supported.
fqdn := c.config.tryFQDN(host)
fqdn := c.config.tryExpandFQDN(host)
cip, ok := c.cipResolver.lookupHost(fqdn)
if ok && len(cip) > 0 {
return cip[0]
Expand Down

0 comments on commit a417fa0

Please sign in to comment.