Documentation
¶
Index ¶
- Variables
- func NewAuthoritativeDNSRecordProvider(ctx context.Context, dc dynamic.Interface, pAccessor v1alpha1.ProviderAccessor, ...) (provider.Provider, error)
- func NewEndpointAccessor(unst *unstructured.Unstructured) (*endpointAccessor, error)
- func NewProviderFromSecret(ctx context.Context, client dynamic.Interface, s *v1.Secret, ...) (provider.Provider, error)
- type AuthoritativeDNSRecordProvider
- func (p AuthoritativeDNSRecordProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error
- func (p AuthoritativeDNSRecordProvider) DNSZoneForHost(ctx context.Context, _ string) (*provider.DNSZone, error)
- func (p AuthoritativeDNSRecordProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error)
- type EndpointProvider
- func (p *EndpointProvider) AdjustEndpoints(endpoints []*endpoint.Endpoint) ([]*endpoint.Endpoint, error)
- func (p *EndpointProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error
- func (p *EndpointProvider) DNSZoneForHost(ctx context.Context, host string) (*provider.DNSZone, error)
- func (p *EndpointProvider) DNSZones(ctx context.Context) ([]provider.DNSZone, error)
- func (p *EndpointProvider) GetDomainFilter() endpoint.DomainFilter
- func (p *EndpointProvider) Labels() map[string]string
- func (p *EndpointProvider) Name() provider.DNSProviderName
- func (p *EndpointProvider) ProviderSpecific() provider.ProviderSpecificLabels
- func (p *EndpointProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error)
Constants ¶
This section is empty.
Variables ¶
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 NewEndpointAccessor ¶
func NewEndpointAccessor(unst *unstructured.Unstructured) (*endpointAccessor, 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 ¶
func (p AuthoritativeDNSRecordProvider) DNSZoneForHost(ctx context.Context, _ string) (*provider.DNSZone, error)
DNSZoneForHost implements Provider.DNSZoneForHost. Ensures the existence of the authoritative record and returns the provider.DNSZone representation of it.
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 ¶
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) 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 ¶
func (p *EndpointProvider) Name() provider.DNSProviderName
Name implements provider.Provider.
func (*EndpointProvider) ProviderSpecific ¶
func (p *EndpointProvider) ProviderSpecific() provider.ProviderSpecificLabels