Documentation
¶
Overview ¶
Package serviceref defines the namespace-qualified identity of a mesh service (proposal 020 Part 1). A mesh service is identified by the pair (namespace, name) — where name is the workload's ServiceAccount — and this package is the single source of truth for how that identity is rendered as:
- a registry / map KEY: "<namespace>/<name>" (Key)
- the mesh FQDN: "<name>.<namespace>.<meshDomain>" (FQDN)
- the standard k8s FQDN: "<name>.<namespace>.svc.cluster.local" (ClusterLocalFQDN)
Centralizing these formats here keeps the namespace from being re-derived from a union or smuggled through bare strings — the exact trap proposal 020 calls out. It is a leaf package (no aether imports) so the registry, agent, CNI, and registrar can all share it without import cycles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceRef ¶
ServiceRef is the namespace-qualified identity of a mesh service. Name is the workload's ServiceAccount (aether's identity unit); Namespace is the Kubernetes namespace the workload runs in.
func New ¶
func New(namespace, name string) ServiceRef
New returns a ServiceRef for the given namespace and name (ServiceAccount).
func ParseKey ¶
func ParseKey(s string) (ref ServiceRef, ok bool)
ParseKey parses a "<namespace>/<name>" key back into a ServiceRef. ok is false when s is not a well-formed key (missing or empty namespace/name) — callers must treat a malformed key as a hard error, never as a namespace-free name.
func (ServiceRef) ClusterLocalFQDN ¶
func (r ServiceRef) ClusterLocalFQDN() string
ClusterLocalFQDN returns the standard Kubernetes name "<name>.<namespace>.svc.cluster.local", which the transparent-capture path also honors so apps reaching a mesh service by its ordinary k8s DNS name are captured (proposal 020 Part 1).
func (ServiceRef) FQDN ¶
func (r ServiceRef) FQDN(meshDomain string) string
FQDN returns the mesh fully-qualified name "<name>.<namespace>.<meshDomain>" — the cluster name / SNI / route-target authority the proxy uses mesh-internally.
func (ServiceRef) Key ¶
func (r ServiceRef) Key() string
Key returns the registry / map key "<namespace>/<name>". This is the namespace-qualified key that replaces the old namespace-free ServiceAccount key (proposal 020 Part 1, hard cutover).
func (ServiceRef) String ¶
func (r ServiceRef) String() string
String returns the Key form, so a ServiceRef formats sensibly in logs.