MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / ServiceDNSNames

Function ServiceDNSNames

internal/naming/dns.go:60–69  ·  view source on GitHub ↗

ServiceDNSNames returns the possible DNS names for service. The first name is the fully qualified domain name (FQDN).

(ctx context.Context, service *corev1.Service)

Source from the content-addressed store, hash-verified

58// ServiceDNSNames returns the possible DNS names for service. The first name
59// is the fully qualified domain name (FQDN).
60func ServiceDNSNames(ctx context.Context, service *corev1.Service) []string {
61 domain := KubernetesClusterDomain(ctx)
62
63 return []string{
64 service.Name + "." + service.Namespace + ".svc." + domain,
65 service.Name + "." + service.Namespace + ".svc",
66 service.Name + "." + service.Namespace,
67 service.Name,
68 }
69}
70
71// KubernetesClusterDomain looks up the Kubernetes cluster domain name.
72func KubernetesClusterDomain(ctx context.Context) string {

Callers 3

SecretFunction · 0.92
TestServiceDNSNamesFunction · 0.85

Calls 1

KubernetesClusterDomainFunction · 0.85

Tested by 1

TestServiceDNSNamesFunction · 0.68