domain

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package domain provides domain-specific, field-level caching for Domain resources. DomainCache embeds cache.ObjectCache and splits its typed helpers into two groups: spec fields (host, routeRef, tlsStrategy, mtlsEnforced, renewBefore), published via PublishResolved right after resolution, and status fields (domainReady, certificateRef, domainMappingRef), published via PublishStatus only after the controller has actually materialised the corresponding resources.

The status half exists specifically so the Route mediator can read certificateRef to gate DomainMapping dispatch on TLS secret existence without an extra API server lookup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainCache

type DomainCache struct {
	*bocache.ObjectCache
}

DomainCache provides domain-specific, field-level caching for Domain resources.

func NewDomainCache

func NewDomainCache(c *cache.Cache) *DomainCache

NewDomainCache constructs a new DomainCache with the provided cache.Cache.

func (*DomainCache) GetCertificateRefName

func (d *DomainCache) GetCertificateRefName(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*DomainCache) GetCertificateRefNamespace

func (d *DomainCache) GetCertificateRefNamespace(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*DomainCache) GetDomainMappingRefName

func (d *DomainCache) GetDomainMappingRefName(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*DomainCache) GetDomainMappingRefNamespace

func (d *DomainCache) GetDomainMappingRefNamespace(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*DomainCache) GetDomainReady

func (d *DomainCache) GetDomainReady(ctx context.Context, nn types.NamespacedName, gen int64) (bool, bool, error)

func (*DomainCache) GetHost

func (d *DomainCache) GetHost(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*DomainCache) GetMTLSEnforced

func (d *DomainCache) GetMTLSEnforced(ctx context.Context, nn types.NamespacedName, gen int64) (bool, bool, error)

func (*DomainCache) GetRenewBefore

func (d *DomainCache) GetRenewBefore(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*DomainCache) GetRouteRef

func (d *DomainCache) GetRouteRef(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*DomainCache) GetTLSStrategy

func (d *DomainCache) GetTLSStrategy(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*DomainCache) PublishResolved

func (d *DomainCache) PublishResolved(ctx context.Context, nn types.NamespacedName, gen int64, res *domainResolution.ResolvedDomain) error

PublishResolved writes the resolved spec contract as a generation-scoped, field-level projection. All writes are best-effort: failures cost queryability, never correctness. Returns the first error encountered for optional logging; callers should not fail reconciliation on it.

func (*DomainCache) PublishStatus

func (d *DomainCache) PublishStatus(
	ctx context.Context,
	nn types.NamespacedName,
	gen int64,
	domainReady bool,
	certRefName, certRefNamespace string,
	mappingRefName, mappingRefNamespace string,
) error

PublishStatus writes controller-observed status fields after resource materialisation. Separate from PublishResolved — these are never derived from spec; they reflect what the controller actually created. The Route mediator reads certificateRef from here to gate DomainMapping dispatch without an additional API server lookup. All writes are best-effort — callers must not fail reconciliation on errors.

func (*DomainCache) SetCertificateRefName

func (d *DomainCache) SetCertificateRefName(ctx context.Context, nn types.NamespacedName, gen int64, name string) error

SetCertificateRefName caches the Certificate resource name emitted by the controller. Set only for custom TLS strategy — empty for platform strategy.

func (*DomainCache) SetCertificateRefNamespace

func (d *DomainCache) SetCertificateRefNamespace(ctx context.Context, nn types.NamespacedName, gen int64, namespace string) error

SetCertificateRefNamespace caches the Certificate resource namespace. For custom strategy this is always the Domain's own namespace.

func (*DomainCache) SetDomainMappingRefName

func (d *DomainCache) SetDomainMappingRefName(ctx context.Context, nn types.NamespacedName, gen int64, name string) error

SetDomainMappingRefName caches the Knative DomainMapping resource name emitted by the controller. Set once materialised, cleared on deletion.

func (*DomainCache) SetDomainMappingRefNamespace

func (d *DomainCache) SetDomainMappingRefNamespace(ctx context.Context, nn types.NamespacedName, gen int64, namespace string) error

SetDomainMappingRefNamespace caches the Knative DomainMapping namespace. Always the Domain's own namespace — cached for mediator fast-path reads.

func (*DomainCache) SetDomainReady

func (d *DomainCache) SetDomainReady(ctx context.Context, nn types.NamespacedName, gen int64, ready bool) error

SetDomainReady caches the scalar domainReady bool from DomainStatus. True once both DomainClaim and DomainMapping are reconciled and active.

func (*DomainCache) SetHost

func (d *DomainCache) SetHost(ctx context.Context, nn types.NamespacedName, gen int64, host string) error

func (*DomainCache) SetMTLSEnforced

func (d *DomainCache) SetMTLSEnforced(ctx context.Context, nn types.NamespacedName, gen int64, enforced bool) error

SetMTLSEnforced caches the enforced flag from ResolvedDomainMTLS.Enforced.

func (*DomainCache) SetRenewBefore

func (d *DomainCache) SetRenewBefore(ctx context.Context, nn types.NamespacedName, gen int64, renewBefore string) error

func (*DomainCache) SetRouteRef

func (d *DomainCache) SetRouteRef(ctx context.Context, nn types.NamespacedName, gen int64, routeRefName string) error

SetRouteRef caches the owning Route name from ResolvedDomainRouteRef.Name.

func (*DomainCache) SetTLSStrategy

func (d *DomainCache) SetTLSStrategy(ctx context.Context, nn types.NamespacedName, gen int64, strategy string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL