endpoint

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RootHostLabel            = "kuadrant.io/rootHost"
	ErrNoSpecFound           = errors.New("no spec found in unstructured object")
	ErrSpecIsInvalid         = errors.New("spec is in an invalid format")
	ErrEndpointsAreInvalid   = errors.New("spec.endpoints is in an invalid format")
	ErrNoRootHost            = errors.New("root host not defined in spec.rootHost or in label: " + RootHostLabel)
	ErrRootHostInvalidFormat = errors.New("root host is defined in an invalid format, it must be of type string")
	ErrNoEndpoints           = errors.New("no endpoints array found in spec")
)

Functions

func NewAuthoritativeDNSRecordProvider

func NewAuthoritativeDNSRecordProvider(ctx context.Context, dc dynamic.Interface, pAccessor v1alpha1.ProviderAccessor, pConfig provider.Config) (provider.Provider, error)

func NewEndpointAccessor

func NewEndpointAccessor(unst *unstructured.Unstructured) (*endpointAccessor, error)

func NewProviderFromSecret

func NewProviderFromSecret(ctx context.Context, client dynamic.Interface, s *v1.Secret, providerConfig provider.Config) (provider.Provider, error)

Types

type AuthoritativeDNSRecordProvider

type AuthoritativeDNSRecordProvider struct {
	*EndpointProvider
	v1alpha1.DNSRecord
}

AuthoritativeDNSRecordProvider adapts the endpoint provider behaviour for the management of authoritative DNSRecord resources for the delegation feature. This provider is intended to be used internally by the provider factory and is not exposed as a provider for user consumption.

DNSZoneForHost and ApplyChanges are adapted to ensure the existence of the expected authoritative record. ApplyChanges will remove the authoritative record for a deleting delegating DNSRecord if no endpoints exist in it after endpoint removal.

func (AuthoritativeDNSRecordProvider) ApplyChanges

func (p AuthoritativeDNSRecordProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error

ApplyChanges implements Provider.ApplyChanges by delegating the request to the embedded endpoint provider. Ensures the existence of the authoritative record before applying changes. Removes the authoritative record if the delegating record is deleting and the result of applying changes produces an empty authoritative record i.e. no other delegating record is adding endpoints to it.

func (AuthoritativeDNSRecordProvider) DNSZoneForHost

DNSZoneForHost implements Provider.DNSZoneForHost. Ensures the existence of the authoritative record and returns the provider.DNSZone representation of it.

func (AuthoritativeDNSRecordProvider) Records

Records implements Provider.Records by delegating the request to the embedded endpoint provider. Ignores any potential not found errors due to the authoritative record having been deleted returning an empty slice in this case.

type EndpointProvider

type EndpointProvider struct {
	NamespacedClient dynamic.ResourceInterface
	// contains filtered or unexported fields
}

EndpointProvider - dns provider only used for testing purposes initialized as dns provider with no records

func (*EndpointProvider) AdjustEndpoints

func (p *EndpointProvider) AdjustEndpoints(endpoints []*endpoint.Endpoint) ([]*endpoint.Endpoint, error)

AdjustEndpoints nothing to do here

func (*EndpointProvider) ApplyChanges

func (p *EndpointProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error

ApplyChanges implements provider.Provider.

func (*EndpointProvider) DNSZoneForHost

func (p *EndpointProvider) DNSZoneForHost(ctx context.Context, host string) (*provider.DNSZone, error)

DNSZoneForHost return the first authoritative DNSRecord with the same DNSRecord.spec.rootHost

func (*EndpointProvider) DNSZones

func (p *EndpointProvider) DNSZones(ctx context.Context) ([]provider.DNSZone, error)

func (*EndpointProvider) GetDomainFilter

func (p *EndpointProvider) GetDomainFilter() endpoint.DomainFilter

GetDomainFilter implements provider.Provider. Subtle: this method shadows the method (BaseProvider).GetDomainFilter of EndpointProvider.BaseProvider.

func (*EndpointProvider) Labels

func (p *EndpointProvider) Labels() map[string]string

func (*EndpointProvider) Name

Name implements provider.Provider.

func (*EndpointProvider) ProviderSpecific

func (p *EndpointProvider) ProviderSpecific() provider.ProviderSpecificLabels

func (*EndpointProvider) Records

func (p *EndpointProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error)

Records returns the list of endpoints

Jump to

Keyboard shortcuts

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