provider

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	R_CREATE = "create"
	R_UPDATE = "update"
	R_DELETE = "delete"
)
View Source
const (
	OPT_IDENTIFIER                 = "identifier"
	OPT_CLASS                      = source.OPT_CLASS
	OPT_DRYRUN                     = "dry-run"
	OPT_TTL                        = "ttl"
	OPT_CACHE_TTL                  = "cache-ttl"
	OPT_SETUP                      = dns.OPT_SETUP
	OPT_DNSDELAY                   = "dns-delay"
	OPT_RESCHEDULEDELAY            = "reschedule-delay"
	OPT_LOCKSTATUSCHECKPERIOD      = "lock-status-check-period"
	OPT_DISABLE_ZONE_STATE_CACHING = "disable-zone-state-caching"
	OPT_DISABLE_DNSNAME_VALIDATION = "disable-dnsname-validation"

	OPT_REMOTE_ACCESS_PORT               = "remote-access-port"
	OPT_REMOTE_ACCESS_CACERT             = "remote-access-cacert"
	OPT_REMOTE_ACCESS_SERVER_SECRET_NAME = "remote-access-server-secret-name"
	OPT_REMOTE_ACCESS_CLIENT_ID          = "remote-access-client-id"

	OPT_PROVIDERTYPES = "provider-types"

	OPT_RATELIMITER_ENABLED = "ratelimiter.enabled"
	OPT_RATELIMITER_QPS     = "ratelimiter.qps"
	OPT_RATELIMITER_BURST   = "ratelimiter.burst"

	OPT_ADVANCED_BATCH_SIZE   = "advanced.batch-size"
	OPT_ADVANCED_MAX_RETRIES  = "advanced.max-retries"
	OPT_ADVANCED_BLOCKED_ZONE = "blocked-zone"

	CMD_HOSTEDZONE_PREFIX = "hostedzone:"
	CMD_STATISTIC         = "statistic"

	MSG_THROTTLING = "provider throttled"
)
View Source
const (
	TARGET_CLUSTER   = source.TARGET_CLUSTER
	PROVIDER_CLUSTER = "provider"
)
View Source
const (
	M_LISTZONES  = "list_zones"
	M_PLISTZONES = "list_zones_pages"

	M_LISTRECORDS  = "list_records"
	M_PLISTRECORDS = "list_records_pages"

	M_UPDATERECORDS = "update_records"
	M_PUPDATEREORDS = "update_records_pages"

	M_CREATERECORDS = "create_records"
	M_DELETERECORDS = "delete_records"

	M_CACHED_GETZONES     = "cached_getzones"
	M_CACHED_GETZONESTATE = "cached_getzonestate"
)
View Source
const (
	AnnotationRemoteAccess = dns.ANNOTATION_GROUP + "/remote-access"
)
View Source
const CONTROLLER_GROUP_DNS_CONTROLLERS = dns.CONTROLLER_GROUP_DNS_CONTROLLERS
View Source
const DNS_POOL = "dns"
View Source
const FACTORY_OPTIONS = "factory"
View Source
const KEY_STATE = "dns-state"
View Source
const MSG_PRESERVED = "errorneous entry preserved in provider"
View Source
const SYNC_ENTRIES = "entries"
View Source
const ZoneCachePrefix = "zc-"

Variables

View Source
var AdvancedOptionsDefaults = AdvancedOptions{
	BatchSize:    50,
	MaxRetries:   7,
	BlockedZones: []string{},
}
View Source
var GenericFactoryOptionDefaults = GenericFactoryOptions{
	RateLimiterOptions: RateLimiterOptionDefaults,
	AdvancedOptions:    AdvancedOptionsDefaults,
}
View Source
var RateLimiterOptionDefaults = RateLimiterOptions{
	Enabled: true,
	QPS:     10,
	Burst:   20,
}
View Source
var RemoteAccessClientID string

RemoteAccessClientID stores the optional client ID for remote access

Functions

func AddRecord

func AddRecord(targetsets dns.RecordSets, ty string, host string, ttl int64)

func AlwaysRateLimiter added in v0.7.12

func AlwaysRateLimiter() flowcontrol.RateLimiter

func CreateFactoryOptionSource added in v0.7.12

func CreateFactoryOptionSource(factory DNSHandlerFactory, prefix string) config.OptionSource

func DNSController

func DNSController(name string, factory DNSHandlerFactory) controller.Configuration

func DNSReconcilerType

func DNSReconcilerType(factory DNSHandlerFactory) controller.ReconcilerType

func FactoryOptionSourceCreator added in v0.7.12

func FactoryOptionSourceCreator(factory DNSHandlerFactory) extension.OptionSourceCreator

func HandlerStringMapper added in v0.7.12

func HandlerStringMapper(name string) func(s string) string

func Match added in v0.8.1

func Match(zone DNSHostedZone, dnsname string) int

func NewDNSState

func NewDNSState(pctx ProviderContext, ownerresc, secretresc resources.Interface, classes *controller.Classes, config Config) *state

func Provider

func Provider(p DNSProvider) string

func StatusMessage

func StatusMessage(s string) *string

func StatusMessagef

func StatusMessagef(msgfmt string, args ...interface{}) *string

func ToDedicatedRecordset added in v0.11.0

func ToDedicatedRecordset(rawrs DedicatedRecordSet) (dns.DNSSetName, *dns.RecordSet)

Types

type AccountCache

type AccountCache struct {
	// contains filtered or unexported fields
}

func NewAccountCache

func NewAccountCache(ttl time.Duration, opts *FactoryOptions) *AccountCache

func (*AccountCache) Get

func (this *AccountCache) Get(logger logger.LogContext, provider *dnsutils.DNSProviderObject, props utils.Properties, state *state) (*DNSAccount, error)

func (*AccountCache) Hash

func (this *AccountCache) Hash(props utils.Properties, ptype string, extension *runtime.RawExtension) string

func (*AccountCache) Release

func (this *AccountCache) Release(logger logger.LogContext, a *DNSAccount, name resources.ObjectName)

type AdvancedConfig added in v0.10.0

type AdvancedConfig struct {
	BatchSize  int
	MaxRetries int
}

func (AdvancedConfig) String added in v0.10.0

func (c AdvancedConfig) String() string

type AdvancedOptions added in v0.10.0

type AdvancedOptions struct {
	BatchSize    int
	MaxRetries   int
	BlockedZones []string
}

func (*AdvancedOptions) AddOptionsToSet added in v0.10.0

func (this *AdvancedOptions) AddOptionsToSet(set config.OptionSet)

func (*AdvancedOptions) GetAdvancedConfig added in v0.10.0

func (c *AdvancedOptions) GetAdvancedConfig() AdvancedConfig

func (*AdvancedOptions) GetBlockedZones added in v0.10.7

func (c *AdvancedOptions) GetBlockedZones() utils.StringSet

func (AdvancedOptions) SetBatchSize added in v0.10.0

func (c AdvancedOptions) SetBatchSize(batchSize int) AdvancedOptions

func (AdvancedOptions) SetMaxRetries added in v0.10.0

func (c AdvancedOptions) SetMaxRetries(maxRetries int) AdvancedOptions

type ChangeGroup

type ChangeGroup struct {
	// contains filtered or unexported fields
}

type ChangeModel

type ChangeModel struct {
	logger.LogContext
	// contains filtered or unexported fields
}

func NewChangeModel

func NewChangeModel(logger logger.LogContext, ownership dns.Ownership, req *zoneReconciliation, config Config) *ChangeModel

func (*ChangeModel) Apply

func (this *ChangeModel) Apply(name dns.DNSSetName, updateGroup string, createdAt time.Time, done DoneHandler, spec TargetSpec) ChangeResult

func (*ChangeModel) ApplySpec added in v0.11.0

func (this *ChangeModel) ApplySpec(set *dns.DNSSet, base *dns.DNSSet, provider DNSProvider, spec TargetSpec) *dns.DNSSet

func (*ChangeModel) Check

func (this *ChangeModel) Check(name dns.DNSSetName, updateGroup string, createdAt time.Time, done DoneHandler, spec TargetSpec) ChangeResult

func (*ChangeModel) Cleanup

func (this *ChangeModel) Cleanup(logger logger.LogContext) bool

func (*ChangeModel) Delete

func (this *ChangeModel) Delete(name dns.DNSSetName, updateGroup string, createdAt time.Time, done DoneHandler, spec TargetSpec) ChangeResult

func (*ChangeModel) Domain

func (this *ChangeModel) Domain() string

func (*ChangeModel) Exec

func (this *ChangeModel) Exec(apply bool, delete bool, name dns.DNSSetName, updateGroup string, createdAt time.Time, done DoneHandler, spec TargetSpec) ChangeResult

func (*ChangeModel) ExistsInEquivalentZone added in v0.12.4

func (this *ChangeModel) ExistsInEquivalentZone(name dns.DNSSetName) bool

func (*ChangeModel) IsFailed added in v0.8.2

func (this *ChangeModel) IsFailed(name dns.DNSSetName) bool

func (*ChangeModel) IsForeign

func (this *ChangeModel) IsForeign(set *dns.DNSSet) bool

func (*ChangeModel) IsStale

func (this *ChangeModel) IsStale(dns ZonedDNSSetName) *Entry

func (*ChangeModel) Owns

func (this *ChangeModel) Owns(set *dns.DNSSet) bool

func (*ChangeModel) PseudoApply added in v0.11.3

func (this *ChangeModel) PseudoApply(name dns.DNSSetName, spec TargetSpec)

func (*ChangeModel) Setup

func (this *ChangeModel) Setup() error

func (*ChangeModel) Update

func (this *ChangeModel) Update(logger logger.LogContext) error

func (*ChangeModel) ZoneId

func (this *ChangeModel) ZoneId() dns.ZoneID

type ChangeRequest

type ChangeRequest struct {
	Action   string
	Type     string
	Addition *dns.DNSSet
	Deletion *dns.DNSSet
	Done     DoneHandler
	Applied  bool
}

func NewChangeRequest

func NewChangeRequest(action string, rtype string, del, add *dns.DNSSet, done DoneHandler) *ChangeRequest

func (*ChangeRequest) IsSemanticEqualTo added in v0.22.2

func (r *ChangeRequest) IsSemanticEqualTo(other *ChangeRequest) bool

type ChangeRequests

type ChangeRequests []*ChangeRequest

type ChangeResult

type ChangeResult struct {
	Modified bool
	Retry    bool
	Error    error
}

type CompoundFactory

type CompoundFactory struct {
	// contains filtered or unexported fields
}

func NewDNSHandlerCompoundFactory

func NewDNSHandlerCompoundFactory(name string) *CompoundFactory

func (*CompoundFactory) Add

func (this *CompoundFactory) Add(f DNSHandlerFactory, finalizer ...string) error

func (*CompoundFactory) Create

func (this *CompoundFactory) Create(typecode string, cfg *DNSHandlerConfig) (DNSHandler, error)

func (*CompoundFactory) CreateOptionSource added in v0.7.12

func (this *CompoundFactory) CreateOptionSource() (config.OptionSource, *GenericFactoryOptions)

func (*CompoundFactory) Finalizers added in v0.7.12

func (this *CompoundFactory) Finalizers() utils.StringSet

func (*CompoundFactory) IsResponsibleFor

func (this *CompoundFactory) IsResponsibleFor(object *dnsutils.DNSProviderObject) bool

func (*CompoundFactory) Name

func (this *CompoundFactory) Name() string

func (*CompoundFactory) SupportZoneStateCache

func (this *CompoundFactory) SupportZoneStateCache(typecode string) (bool, error)

func (*CompoundFactory) TypeCodes

func (this *CompoundFactory) TypeCodes() utils.StringSet

type Config

type Config struct {
	TTL                      int64
	CacheTTL                 time.Duration
	RescheduleDelay          time.Duration
	StatusCheckPeriod        time.Duration
	Ident                    string
	Dryrun                   bool
	ZoneStateCaching         bool
	DisableDNSNameValidation bool
	Delay                    time.Duration
	EnabledTypes             utils.StringSet
	Options                  *FactoryOptions
	Factory                  DNSHandlerFactory
	RemoteAccessConfig       *embed.RemoteAccessServerConfig
}

func NewConfigForController

func NewConfigForController(c controller.Interface, factory DNSHandlerFactory) (*Config, error)

type DNSAccount

type DNSAccount struct {
	*dnsutils.RateLimiter
	// contains filtered or unexported fields
}

func NewDNSAccount added in v0.7.9

func NewDNSAccount(config utils.Properties, handler DNSHandler, hash string) *DNSAccount

func (*DNSAccount) AddGenericRequests added in v0.8.4

func (this *DNSAccount) AddGenericRequests(requestType string, n int)

func (*DNSAccount) AddZoneRequests added in v0.8.4

func (this *DNSAccount) AddZoneRequests(zoneID, requestType string, n int)

func (*DNSAccount) ExecuteRequests

func (this *DNSAccount) ExecuteRequests(logger logger.LogContext, zone DNSHostedZone, state DNSZoneState, reqs []*ChangeRequest) error

func (*DNSAccount) GetZoneState

func (this *DNSAccount) GetZoneState(zone DNSHostedZone) (DNSZoneState, error)

func (*DNSAccount) GetZones

func (this *DNSAccount) GetZones() (DNSHostedZones, error)

func (*DNSAccount) Hash

func (this *DNSAccount) Hash() string

func (*DNSAccount) MapTargets added in v0.17.0

func (this *DNSAccount) MapTargets(dnsName string, targets []Target) []Target

func (*DNSAccount) ProviderType

func (this *DNSAccount) ProviderType() string

func (*DNSAccount) Release

func (this *DNSAccount) Release()

func (*DNSAccount) ReportZoneStateConflict

func (this *DNSAccount) ReportZoneStateConflict(zone DNSHostedZone, err error) bool

type DNSHandler

type DNSHandler interface {
	ProviderType() string
	GetZones() (DNSHostedZones, error)
	GetZoneState(DNSHostedZone) (DNSZoneState, error)
	ReportZoneStateConflict(zone DNSHostedZone, err error) bool
	ExecuteRequests(logger logger.LogContext, zone DNSHostedZone, state DNSZoneState, reqs []*ChangeRequest) error
	MapTargets(dnsName string, targets []Target) []Target
	Release()
}

type DNSHandlerConfig

type DNSHandlerConfig struct {
	Logger           logger.LogContext
	Properties       utils.Properties
	Config           *runtime.RawExtension
	DryRun           bool
	Context          context.Context
	ZoneCacheFactory ZoneCacheFactory
	Options          *FactoryOptions
	Metrics          Metrics
	RateLimiter      flowcontrol.RateLimiter
}

func (*DNSHandlerConfig) Complete added in v0.10.0

func (c *DNSHandlerConfig) Complete() error

func (*DNSHandlerConfig) FillDefaultedBoolProperty added in v0.7.21

func (c *DNSHandlerConfig) FillDefaultedBoolProperty(target **bool, def bool, prop string, alt ...string) error

func (*DNSHandlerConfig) FillDefaultedIntProperty added in v0.7.7

func (c *DNSHandlerConfig) FillDefaultedIntProperty(target **int, def int, prop string, alt ...string) error

func (*DNSHandlerConfig) FillDefaultedProperty added in v0.7.14

func (c *DNSHandlerConfig) FillDefaultedProperty(target **string, def string, prop string, alt ...string) error

func (*DNSHandlerConfig) FillRequiredIntProperty added in v0.7.7

func (c *DNSHandlerConfig) FillRequiredIntProperty(target **int, prop string, alt ...string) error

func (*DNSHandlerConfig) FillRequiredProperty added in v0.7.7

func (c *DNSHandlerConfig) FillRequiredProperty(target **string, prop string, alt ...string) error

func (*DNSHandlerConfig) GetDefaultedBoolProperty added in v0.7.21

func (c *DNSHandlerConfig) GetDefaultedBoolProperty(key string, def bool, altKeys ...string) (bool, error)

func (*DNSHandlerConfig) GetDefaultedIntProperty added in v0.7.7

func (c *DNSHandlerConfig) GetDefaultedIntProperty(key string, def int, altKeys ...string) (int, error)

func (*DNSHandlerConfig) GetDefaultedProperty added in v0.7.7

func (c *DNSHandlerConfig) GetDefaultedProperty(key string, def string, altKeys ...string) string

func (*DNSHandlerConfig) GetProperty

func (c *DNSHandlerConfig) GetProperty(key string, altKeys ...string) string

func (*DNSHandlerConfig) GetRequiredBoolProperty added in v0.7.21

func (c *DNSHandlerConfig) GetRequiredBoolProperty(key string, altKeys ...string) (bool, error)

func (*DNSHandlerConfig) GetRequiredIntProperty added in v0.7.7

func (c *DNSHandlerConfig) GetRequiredIntProperty(key string, altKeys ...string) (int, error)

func (*DNSHandlerConfig) GetRequiredProperty

func (c *DNSHandlerConfig) GetRequiredProperty(key string, altKeys ...string) (string, error)

type DNSHandlerCreatorFunction

type DNSHandlerCreatorFunction func(config *DNSHandlerConfig) (DNSHandler, error)

type DNSHandlerFactory

type DNSHandlerFactory interface {
	Name() string
	TypeCodes() utils.StringSet
	Create(typecode string, config *DNSHandlerConfig) (DNSHandler, error)
	IsResponsibleFor(object *dnsutils.DNSProviderObject) bool
	SupportZoneStateCache(typecode string) (bool, error)
}

type DNSHandlerOptionSource added in v0.7.12

type DNSHandlerOptionSource interface {
	CreateOptionSource() (local config.OptionSource, defaults *GenericFactoryOptions)
}

type DNSHostedZone

type DNSHostedZone interface {
	Key() string
	Id() dns.ZoneID
	Domain() string
	ForwardedDomains() []string
	Match(dnsname string) int
	IsPrivate() bool
}

func CopyDNSHostedZone

func CopyDNSHostedZone(zone DNSHostedZone, forwardedDomains []string) DNSHostedZone

func NewDNSHostedZone

func NewDNSHostedZone(providerType, id, domain, key string, isPrivate bool) DNSHostedZone

type DNSHostedZones

type DNSHostedZones []DNSHostedZone

func (DNSHostedZones) EquivalentTo added in v0.12.0

func (this DNSHostedZones) EquivalentTo(infos DNSHostedZones) bool

type DNSProvider

type DNSProvider interface {
	ObjectName() resources.ObjectName
	Object() resources.Object
	TypeCode() string

	DefaultTTL() int64

	GetZones() DNSHostedZones
	IncludesZone(zoneID dns.ZoneID) bool
	HasEquivalentZone(zoneID dns.ZoneID) bool

	GetZoneState(zone DNSHostedZone) (DNSZoneState, error)
	ExecuteRequests(logger logger.LogContext, zone DNSHostedZone, state DNSZoneState, requests []*ChangeRequest) error

	GetDedicatedDNSAccess() DedicatedDNSAccess

	Match(dns string) int
	MatchZone(dns string) int
	IsValid() bool

	AccountHash() string
	MapTargets(dnsName string, targets []Target) []Target

	// ReportZoneStateConflict is used to report a conflict because of stale data.
	// It returns true if zone data will be updated and a retry may resolve the conflict
	ReportZoneStateConflict(zone DNSHostedZone, err error) bool
}

type DNSProviders

type DNSProviders map[resources.ObjectName]DNSProvider

func (DNSProviders) LookupFor

func (this DNSProviders) LookupFor(dns string) DNSProvider

type DNSZoneState

type DNSZoneState interface {
	GetDNSSets() dns.DNSSets
}

func NewDNSZoneState

func NewDNSZoneState(sets dns.DNSSets) DNSZoneState

type DedicatedDNSAccess added in v0.11.0

type DedicatedDNSAccess interface {
	GetRecordSet(zone DNSHostedZone, name dns.DNSSetName, recordType string) (DedicatedRecordSet, error)
	CreateOrUpdateRecordSet(logger logger.LogContext, zone DNSHostedZone, old, new DedicatedRecordSet) error
	DeleteRecordSet(logger logger.LogContext, zone DNSHostedZone, rs DedicatedRecordSet) error
}

type DedicatedRecord added in v0.11.0

type DedicatedRecord interface {
	GetType() string
	GetValue() string
	GetDNSName() string
	GetSetIdentifier() string
	GetTTL() int64
}

type DedicatedRecordSet added in v0.11.0

type DedicatedRecordSet []DedicatedRecord

func FromDedicatedRecordSet added in v0.11.0

func FromDedicatedRecordSet(setName dns.DNSSetName, rs *dns.RecordSet) DedicatedRecordSet

func (DedicatedRecordSet) GetAttr added in v0.11.0

func (rs DedicatedRecordSet) GetAttr(name string) string

type DefaultContext

type DefaultContext struct {
	logger.LogContext
	// contains filtered or unexported fields
}

func (*DefaultContext) Enqueue

func (this *DefaultContext) Enqueue(obj resources.Object) error

func (*DefaultContext) EnqueueCommand

func (this *DefaultContext) EnqueueCommand(cmd string) error

func (*DefaultContext) EnqueueKey

func (this *DefaultContext) EnqueueKey(key resources.ClusterObjectKey) error

func (*DefaultContext) GetByExample

func (this *DefaultContext) GetByExample(obj runtime.Object) (resources.Interface, error)

func (*DefaultContext) GetCluster added in v0.10.3

func (this *DefaultContext) GetCluster(name string) resources.Cluster

func (*DefaultContext) GetContext

func (this *DefaultContext) GetContext() context.Context

func (*DefaultContext) GetIntOption

func (this *DefaultContext) GetIntOption(name string) (int, error)

func (*DefaultContext) GetPool added in v0.10.7

func (this *DefaultContext) GetPool(name string) controller.Pool

func (*DefaultContext) GetPoolPeriod

func (this *DefaultContext) GetPoolPeriod(name string) *time.Duration

func (*DefaultContext) GetSecretPropertiesByRef

func (*DefaultContext) GetStringOption added in v0.7.12

func (this *DefaultContext) GetStringOption(name string) (string, error)

func (*DefaultContext) HasFinalizer

func (this *DefaultContext) HasFinalizer(obj resources.Object) bool

func (*DefaultContext) IsReady

func (this *DefaultContext) IsReady() bool

func (*DefaultContext) RemoveFinalizer

func (this *DefaultContext) RemoveFinalizer(obj resources.Object) error

func (*DefaultContext) SetFinalizer

func (this *DefaultContext) SetFinalizer(obj resources.Object) error

func (*DefaultContext) Synchronize added in v0.7.12

func (this *DefaultContext) Synchronize(log logger.LogContext, name string, obj resources.Object) (bool, error)

type DefaultDNSHandler

type DefaultDNSHandler struct {
	// contains filtered or unexported fields
}

func NewDefaultDNSHandler

func NewDefaultDNSHandler(providerType string) DefaultDNSHandler

func (*DefaultDNSHandler) MapTargets added in v0.17.0

func (this *DefaultDNSHandler) MapTargets(_ string, targets []Target) []Target

func (*DefaultDNSHandler) ProviderType

func (this *DefaultDNSHandler) ProviderType() string

type DefaultDNSHostedZone

type DefaultDNSHostedZone struct {
	// contains filtered or unexported fields
}

func (*DefaultDNSHostedZone) Domain

func (this *DefaultDNSHostedZone) Domain() string

func (*DefaultDNSHostedZone) ForwardedDomains

func (this *DefaultDNSHostedZone) ForwardedDomains() []string

func (*DefaultDNSHostedZone) Id

func (this *DefaultDNSHostedZone) Id() dns.ZoneID

func (*DefaultDNSHostedZone) IsPrivate

func (this *DefaultDNSHostedZone) IsPrivate() bool

func (*DefaultDNSHostedZone) Key

func (this *DefaultDNSHostedZone) Key() string

func (*DefaultDNSHostedZone) Match added in v0.8.1

func (this *DefaultDNSHostedZone) Match(dnsname string) int

type DefaultDNSZoneState

type DefaultDNSZoneState struct {
	// contains filtered or unexported fields
}

func (*DefaultDNSZoneState) Clone added in v0.7.14

func (this *DefaultDNSZoneState) Clone() DNSZoneState

func (*DefaultDNSZoneState) GetDNSSets

func (this *DefaultDNSZoneState) GetDNSSets() dns.DNSSets

type DoneHandler

type DoneHandler interface {
	SetInvalid(err error)
	Failed(err error)
	Throttled()
	Succeeded()
}

func NewStatusUpdate

func NewStatusUpdate(logger logger.LogContext, e *Entry, f FinalizerHandler) DoneHandler

type DumpDNSHostedZone

type DumpDNSHostedZone struct {
	ProviderType     string
	Key              string
	Id               string
	Domain           string
	ForwardedDomains []string
}

type Entries

type Entries map[resources.ObjectName]*Entry

func (Entries) AddActiveZoneTo added in v0.7.18

func (this Entries) AddActiveZoneTo(zoneid dns.ZoneID, list *EntryList)

func (Entries) AddEntry

func (this Entries) AddEntry(entry *Entry) *Entry

func (Entries) AddResponsibleTo added in v0.7.12

func (this Entries) AddResponsibleTo(list *EntryList)

func (Entries) Delete

func (this Entries) Delete(e *Entry)

type Entry

type Entry struct {
	*EntryVersion
	// contains filtered or unexported fields
}

func NewEntry

func NewEntry(v *EntryVersion, state *state) *Entry

func (*Entry) Before

func (this *Entry) Before(e *Entry) bool

func (*Entry) CreatedAt

func (this *Entry) CreatedAt() time.Time

func (*Entry) IsActive

func (this *Entry) IsActive() bool

func (*Entry) IsModified

func (this *Entry) IsModified() bool

func (*Entry) RemoveFinalizer added in v0.7.12

func (this *Entry) RemoveFinalizer() error

func (*Entry) Trigger

func (this *Entry) Trigger(logger logger.LogContext)

func (*Entry) Update

func (this *Entry) Update(logger logger.LogContext, new *EntryVersion) *Entry

type EntryList

type EntryList []*Entry

func (EntryList) Len

func (this EntryList) Len() int

func (EntryList) Less

func (this EntryList) Less(i, j int) bool

func (EntryList) Lock

func (this EntryList) Lock() error

func (EntryList) Sort

func (this EntryList) Sort()

func (EntryList) Swap

func (this EntryList) Swap(i, j int)

func (EntryList) Unlock

func (this EntryList) Unlock()

func (EntryList) UpdateStatistic added in v0.7.12

func (this EntryList) UpdateStatistic(statistic *statistic.EntryStatistic)

type EntryPremise

type EntryPremise struct {
	// contains filtered or unexported fields
}

func (*EntryPremise) Match added in v0.7.12

func (this *EntryPremise) Match(p *EntryPremise) bool

func (*EntryPremise) NotifyChange

func (this *EntryPremise) NotifyChange(p *EntryPremise) string

type EntryVersion

type EntryVersion struct {
	// contains filtered or unexported fields
}

func NewEntryVersion

func NewEntryVersion(object *dnsutils.DNSEntryObject, old *Entry) *EntryVersion

func (*EntryVersion) ClusterKey

func (this *EntryVersion) ClusterKey() resources.ClusterObjectKey

func (*EntryVersion) DNSName

func (this *EntryVersion) DNSName() string

func (*EntryVersion) DNSSetName added in v0.13.0

func (this *EntryVersion) DNSSetName() dns.DNSSetName

func (*EntryVersion) Description

func (this *EntryVersion) Description() string

func (*EntryVersion) GetAnnotations added in v0.17.0

func (this *EntryVersion) GetAnnotations() map[string]string

func (*EntryVersion) GetSetIdentifier added in v0.13.0

func (this *EntryVersion) GetSetIdentifier() string

func (*EntryVersion) Interval

func (this *EntryVersion) Interval() int64

func (*EntryVersion) IsDeleting

func (this *EntryVersion) IsDeleting() bool

func (*EntryVersion) IsResponsible added in v0.7.7

func (this *EntryVersion) IsResponsible() bool

func (*EntryVersion) IsValid

func (this *EntryVersion) IsValid() bool

func (*EntryVersion) KeepRecords added in v0.8.3

func (this *EntryVersion) KeepRecords() bool

func (*EntryVersion) Message

func (this *EntryVersion) Message() string

func (*EntryVersion) NotRateLimited added in v0.11.3

func (this *EntryVersion) NotRateLimited() bool

NotRateLimited checks for annotation dns.gardener.cloud/not-rate-limited

func (*EntryVersion) Object

func (this *EntryVersion) Object() *dnsutils.DNSEntryObject

func (*EntryVersion) ObjectName

func (this *EntryVersion) ObjectName() resources.ObjectName

func (*EntryVersion) OwnerId

func (this *EntryVersion) OwnerId() string

func (*EntryVersion) ProviderName added in v0.7.12

func (this *EntryVersion) ProviderName() resources.ObjectName

func (*EntryVersion) ProviderType added in v0.7.7

func (this *EntryVersion) ProviderType() string

func (*EntryVersion) RequiresUpdateFor

func (this *EntryVersion) RequiresUpdateFor(e *EntryVersion) (reasons []string)

func (*EntryVersion) RoutingPolicy added in v0.13.0

func (this *EntryVersion) RoutingPolicy() *dns.RoutingPolicy

func (*EntryVersion) Setup

func (this *EntryVersion) Setup(logger logger.LogContext, state *state, p *EntryPremise, op string, err error, config Config) reconcile.Status

func (*EntryVersion) State

func (this *EntryVersion) State() string

func (*EntryVersion) TTL

func (this *EntryVersion) TTL() int64

func (*EntryVersion) Targets

func (this *EntryVersion) Targets() Targets

func (*EntryVersion) UpdateState added in v0.11.3

func (this *EntryVersion) UpdateState(logger logger.LogContext, state, msg string) (bool, error)

func (*EntryVersion) UpdateStatus

func (this *EntryVersion) UpdateStatus(logger logger.LogContext, state string, msg string) (bool, error)

func (*EntryVersion) ZoneId

func (this *EntryVersion) ZoneId() dns.ZoneID

func (*EntryVersion) ZonedDNSName added in v0.10.7

func (this *EntryVersion) ZonedDNSName() ZonedDNSSetName

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func NewDNSHandlerFactory

func NewDNSHandlerFactory(typecode string, create DNSHandlerCreatorFunction, disableZoneStateCache ...bool) *Factory

func (*Factory) Create

func (this *Factory) Create(typecode string, config *DNSHandlerConfig) (DNSHandler, error)

func (*Factory) CreateOptionSource added in v0.7.12

func (this *Factory) CreateOptionSource() (config.OptionSource, *GenericFactoryOptions)

func (*Factory) IsResponsibleFor

func (this *Factory) IsResponsibleFor(object *dnsutils.DNSProviderObject) bool

func (*Factory) Name

func (this *Factory) Name() string

func (*Factory) SetGenericFactoryOptionDefaults added in v0.7.12

func (this *Factory) SetGenericFactoryOptionDefaults(defaults ...GenericFactoryOptions) *Factory

func (*Factory) SetOptionSourceByExample added in v0.7.12

func (this *Factory) SetOptionSourceByExample(proto config.OptionSource, defaults ...GenericFactoryOptions) *Factory

func (*Factory) SetOptionSourceCreator added in v0.7.12

func (this *Factory) SetOptionSourceCreator(creator extension.OptionSourceCreator, defaults ...GenericFactoryOptions) *Factory

func (*Factory) SupportZoneStateCache

func (this *Factory) SupportZoneStateCache(typecode string) (bool, error)

func (*Factory) TypeCodes

func (this *Factory) TypeCodes() utils.StringSet

type FactoryOptions added in v0.7.12

type FactoryOptions struct {
	// type specific options
	Options config.OptionSource
	// generic options for all factory types
	GenericFactoryOptions
}

FactoryOptions is a set of generic options and type specific options related to factories that are provided for all provider types but in a provider specific manner. The provide specif options are defined by an option source optionally offered by the provider factory. It is handled by the compound factory, also, to provide dedicated option sets for hosted sub factories.

func GetFactoryOptions added in v0.7.12

func GetFactoryOptions(src config.OptionSource) *FactoryOptions

func (*FactoryOptions) AddOptionsToSet added in v0.7.12

func (this *FactoryOptions) AddOptionsToSet(set config.OptionSet)

func (*FactoryOptions) Evaluate added in v0.7.12

func (this *FactoryOptions) Evaluate() error

type FinalizerHandler

type FinalizerHandler interface {
	SetFinalizer(name resources.Object) error
	RemoveFinalizer(name resources.Object) error
}

type Finalizers added in v0.7.12

type Finalizers interface {
	Finalizers() utils.StringSet
}

type FullDump

type FullDump struct {
	InMemory map[dns.ZoneID]*ZoneDump
}

func (*FullDump) ToYAMLString added in v0.22.2

func (d *FullDump) ToYAMLString() string

type GenericFactoryOptions added in v0.7.12

type GenericFactoryOptions struct {
	RateLimiterOptions
	AdvancedOptions
}

func (*GenericFactoryOptions) AddOptionsToSet added in v0.7.12

func (this *GenericFactoryOptions) AddOptionsToSet(set config.OptionSet)

func (GenericFactoryOptions) SetAdvancedOptions added in v0.10.0

func (this GenericFactoryOptions) SetAdvancedOptions(o AdvancedOptions) GenericFactoryOptions

func (GenericFactoryOptions) SetRateLimiterOptions added in v0.7.12

func (this GenericFactoryOptions) SetRateLimiterOptions(o RateLimiterOptions) GenericFactoryOptions

type InMemory

type InMemory struct {
	// contains filtered or unexported fields
}

InMemory is a simple in-memory DNS provider implementation

func NewInMemory

func NewInMemory() *InMemory

func (*InMemory) AddApplyFailSimulation added in v0.22.2

func (m *InMemory) AddApplyFailSimulation(id dns.ZoneID, request *ChangeRequest) string

func (*InMemory) AddZone

func (m *InMemory) AddZone(zone DNSHostedZone) bool

func (*InMemory) Apply

func (m *InMemory) Apply(zoneID dns.ZoneID, request *ChangeRequest, metrics Metrics) error

func (*InMemory) BuildFullDump

func (m *InMemory) BuildFullDump() *FullDump

func (*InMemory) CloneZoneState

func (m *InMemory) CloneZoneState(zone DNSHostedZone) (DNSZoneState, error)

func (*InMemory) DeleteZone

func (m *InMemory) DeleteZone(zoneID dns.ZoneID)

func (*InMemory) FindHostedZone

func (m *InMemory) FindHostedZone(zoneid dns.ZoneID) DNSHostedZone

func (*InMemory) GetApplyFailSimulationCount added in v0.22.2

func (m *InMemory) GetApplyFailSimulationCount(uid string) int

func (*InMemory) GetZones

func (m *InMemory) GetZones() DNSHostedZones

func (*InMemory) RemoveApplyFailSimulation added in v0.22.2

func (m *InMemory) RemoveApplyFailSimulation(uid string) bool

func (*InMemory) SetZone

func (m *InMemory) SetZone(zone DNSHostedZone, zoneState DNSZoneState)

type LightDNSHandler added in v0.12.0

type LightDNSHandler interface {
	ProviderType() string
	GetZones() (DNSHostedZones, error)
	GetZoneState(DNSHostedZone) (DNSZoneState, error)
	ExecuteRequests(logger logger.LogContext, zone DNSHostedZone, state DNSZoneState, reqs []*ChangeRequest) error
}

type Metrics

type Metrics interface {
	AddGenericRequests(requestType string, n int)
	AddZoneRequests(zoneID, requestType string, n int)
}

type NullMetrics

type NullMetrics struct{}

func (*NullMetrics) AddGenericRequests added in v0.8.4

func (m *NullMetrics) AddGenericRequests(_ string, _ int)

func (*NullMetrics) AddZoneRequests added in v0.8.4

func (m *NullMetrics) AddZoneRequests(_, _ string, _ int)

type OwnerCache

type OwnerCache struct {
	// contains filtered or unexported fields
}

func NewOwnerCache

func NewOwnerCache(ctx ProviderCacheContext, config *Config) *OwnerCache

func (*OwnerCache) DeleteOwner

func (this *OwnerCache) DeleteOwner(key resources.ClusterObjectKey) (changeset utils.StringSet, activeset utils.StringSet)

func (*OwnerCache) GetIds

func (this *OwnerCache) GetIds() utils.StringSet

func (*OwnerCache) IsResponsibleFor

func (this *OwnerCache) IsResponsibleFor(id string) bool

func (*OwnerCache) IsResponsiblePendingFor added in v0.7.21

func (this *OwnerCache) IsResponsiblePendingFor(id string) bool

func (*OwnerCache) SetPending added in v0.7.21

func (this *OwnerCache) SetPending(id string)

func (*OwnerCache) UpdateCountsWith added in v0.7.12

func (this *OwnerCache) UpdateCountsWith(statistic statistic.OwnerStatistic, types utils.StringSet) OwnerCounts

func (*OwnerCache) UpdateOwner

func (this *OwnerCache) UpdateOwner(owner *dnsutils.DNSOwnerObject) (changeset utils.StringSet, activeset utils.StringSet)

type OwnerCounts added in v0.7.12

type OwnerCounts map[OwnerName]ProviderTypeCounts

type OwnerIDInfo added in v0.7.12

type OwnerIDInfo struct {
	// contains filtered or unexported fields
}

type OwnerIDInfos added in v0.7.12

type OwnerIDInfos map[string]OwnerIDInfo

func (OwnerIDInfos) Contains added in v0.7.12

func (this OwnerIDInfos) Contains(id string) bool

func (OwnerIDInfos) KeySet added in v0.7.12

func (this OwnerIDInfos) KeySet() utils.StringSet

type OwnerName added in v0.7.17

type OwnerName string

type OwnerObjectInfo added in v0.7.12

type OwnerObjectInfo struct {
	// contains filtered or unexported fields
}

type OwnerObjectInfos added in v0.7.12

type OwnerObjectInfos map[OwnerName]OwnerObjectInfo

type ProviderCacheContext added in v0.10.3

type ProviderCacheContext interface {
	GetContext() context.Context
	EnqueueKey(key resources.ClusterObjectKey) error

	Infof(msg string, args ...interface{})
}

type ProviderContext added in v0.19.0

type ProviderContext interface {
	logger.LogContext

	GetContext() context.Context

	IsReady() bool
	GetByExample(runtime.Object) (resources.Interface, error)

	GetStringOption(name string) (string, error)
	GetIntOption(name string) (int, error)

	Synchronize(log logger.LogContext, name string, initiator resources.Object) (bool, error)

	Enqueue(obj resources.Object) error
	EnqueueCommand(cmd string) error
	EnqueueKey(key resources.ClusterObjectKey) error

	SetFinalizer(resources.Object) error
	RemoveFinalizer(resources.Object) error
	HasFinalizer(resources.Object) bool

	GetSecretPropertiesByRef(src resources.ResourcesSource, ref *corev1.SecretReference) (utils.Properties, *resources.SecretObject, error)
	GetPoolPeriod(name string) *time.Duration

	GetCluster(name string) resources.Cluster

	GetPool(name string) controller.Pool
}

func NewDefaultContext

func NewDefaultContext(controller controller.Interface) ProviderContext

type ProviderEventListener added in v0.12.0

type ProviderEventListener interface {
	ProviderUpdatedEvent(logger logger.LogContext, name resources.ObjectName, annotations map[string]string, handler LightDNSHandler)
	ProviderRemovedEvent(logger logger.LogContext, name resources.ObjectName)
}

type ProviderTypeCounts added in v0.7.12

type ProviderTypeCounts map[string]int

type RateLimiterConfig added in v0.7.12

type RateLimiterConfig struct {
	QPS   float32
	Burst int
}

func (*RateLimiterConfig) NewRateLimiter added in v0.7.12

func (c *RateLimiterConfig) NewRateLimiter() (flowcontrol.RateLimiter, error)

func (*RateLimiterConfig) String added in v0.7.12

func (c *RateLimiterConfig) String() string

type RateLimiterOptions added in v0.7.12

type RateLimiterOptions struct {
	Enabled bool
	QPS     int
	Burst   int
}

func (*RateLimiterOptions) AddOptionsToSet added in v0.7.12

func (this *RateLimiterOptions) AddOptionsToSet(set config.OptionSet)

func (*RateLimiterOptions) GetRateLimiterConfig added in v0.7.12

func (c *RateLimiterOptions) GetRateLimiterConfig() *RateLimiterConfig

func (RateLimiterOptions) SetBurst added in v0.7.12

func (c RateLimiterOptions) SetBurst(burst int) RateLimiterOptions

func (RateLimiterOptions) SetEnabled added in v0.7.12

func (c RateLimiterOptions) SetEnabled(enabled bool) RateLimiterOptions

func (RateLimiterOptions) SetQPS added in v0.7.12

type References added in v0.7.12

type References struct {
	// contains filtered or unexported fields
}

func NewReferenceCache added in v0.7.12

func NewReferenceCache() *References

func (*References) AddRef added in v0.7.12

func (*References) DelRef added in v0.7.12

func (this *References) DelRef(holder resources.ClusterObjectKey)

func (*References) NotifyHolder added in v0.7.12

func (this *References) NotifyHolder(pctx ProviderContext, ref resources.ClusterObjectKey)

type StateTTLGetter added in v0.10.3

type StateTTLGetter func(zoneid dns.ZoneID) time.Duration

type StatusUpdate

type StatusUpdate struct {
	*Entry
	// contains filtered or unexported fields
}

func (*StatusUpdate) Failed

func (this *StatusUpdate) Failed(err error)

func (*StatusUpdate) SetInvalid

func (this *StatusUpdate) SetInvalid(err error)

func (*StatusUpdate) Succeeded

func (this *StatusUpdate) Succeeded()

func (*StatusUpdate) Throttled added in v0.11.3

func (this *StatusUpdate) Throttled()

type Target

type Target = dnsutils.Target

func NewHostTargetFromEntryVersion added in v0.11.0

func NewHostTargetFromEntryVersion(name string, entry *EntryVersion) (Target, error)

type TargetSpec added in v0.11.0

type TargetSpec = dnsutils.TargetSpec

type Targets

type Targets = dnsutils.Targets

type Ticker added in v0.10.7

type Ticker struct {
	// contains filtered or unexported fields
}

func NewTicker added in v0.10.7

func NewTicker(ticker func()) *Ticker

func (*Ticker) TickWhile added in v0.10.7

func (t *Ticker) TickWhile(log logger.LogContext, f func())

type ZoneCache

type ZoneCache interface {
	GetZones() (DNSHostedZones, error)
	GetZoneState(zone DNSHostedZone) (DNSZoneState, error)
	ApplyRequests(logctx logger.LogContext, err error, zone DNSHostedZone, reqs []*ChangeRequest)
	Release()
	ReportZoneStateConflict(zone DNSHostedZone, err error) bool
}

type ZoneCacheFactory added in v0.12.6

type ZoneCacheFactory struct {
	// contains filtered or unexported fields
}

func NewTestZoneCacheFactory added in v0.12.6

func NewTestZoneCacheFactory(zonesTTL, stateTTL time.Duration) *ZoneCacheFactory

func (ZoneCacheFactory) CreateZoneCache added in v0.12.6

func (c ZoneCacheFactory) CreateZoneCache(cacheType ZoneCacheType, metrics Metrics, zonesUpdater ZoneCacheZoneUpdater, stateUpdater ZoneCacheStateUpdater) (ZoneCache, error)

type ZoneCacheStateUpdater

type ZoneCacheStateUpdater func(zone DNSHostedZone, cache ZoneCache) (DNSZoneState, error)

type ZoneCacheType added in v0.12.6

type ZoneCacheType int

ZoneCacheType is the zone cache type.

const (
	// CacheZonesOnly only caches the zones of the account, but not the zone state itself.
	CacheZonesOnly ZoneCacheType = iota
	// CacheZoneState caches both zones of the account and the zone states as needed.
	CacheZoneState
)

type ZoneCacheZoneUpdater

type ZoneCacheZoneUpdater func(cache ZoneCache) (DNSHostedZones, error)

type ZoneDump

type ZoneDump struct {
	HostedZone DumpDNSHostedZone
	DNSSets    dns.DNSSets
}

type ZonedDNSSetName added in v0.13.0

type ZonedDNSSetName struct {
	dns.DNSSetName
	ZoneID dns.ZoneID
}

func (ZonedDNSSetName) String added in v0.13.0

func (z ZonedDNSSetName) String() string

type ZonedDNSSetNames added in v0.13.0

type ZonedDNSSetNames map[ZonedDNSSetName]*Entry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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