Documentation
¶
Index ¶
- Constants
- func Add(mgr manager.Manager, args AddArgs) error
- func ClusterToDNSRecordMapper(reader client.Reader, predicates []predicate.Predicate) handler.MapFunc
- func DefaultPredicates(ctx context.Context, mgr manager.Manager, ignoreOperationAnnotation bool) []predicate.Predicate
- func FindZoneForName(zones map[string]string, name string) string
- func GetMetaRecordName(name string) string
- func MatchesDomain(name, domain string) bool
- func NewReconciler(mgr manager.Manager, actuator Actuator) reconcile.Reconciler
- type Actuator
- type AddArgs
Constants ¶
const ( // FinalizerName is the dnsrecord controller finalizer. FinalizerName = "extensions.gardener.cloud/dnsrecord" // ControllerName is the name of the controller ControllerName = "dnsrecord" )
Variables ¶
This section is empty.
Functions ¶
func ClusterToDNSRecordMapper ¶
func ClusterToDNSRecordMapper(reader client.Reader, predicates []predicate.Predicate) handler.MapFunc
ClusterToDNSRecordMapper returns a mapper that returns requests for DNSRecords whose referenced clusters have been modified.
func DefaultPredicates ¶
func DefaultPredicates(ctx context.Context, mgr manager.Manager, ignoreOperationAnnotation bool) []predicate.Predicate
DefaultPredicates returns the default predicates for a dnsrecord reconciler.
func FindZoneForName ¶
FindZoneForName returns the zone ID for the longest zone domain from the given zones map that is matched by the given name. If the given name doesn't match any of the zone domains in the given zones map, an empty string is returned.
func GetMetaRecordName ¶
GetMetaRecordName returns the meta record name for the given name.
func MatchesDomain ¶
MatchesDomain returns true if the given name matches (is a subdomain) of the given domain, false otherwise.
func NewReconciler ¶
func NewReconciler(mgr manager.Manager, actuator Actuator) reconcile.Reconciler
NewReconciler creates a new reconcile.Reconciler that reconciles dnsrecord resources of Gardener's `extensions.gardener.cloud` API group.
Types ¶
type Actuator ¶
type Actuator interface {
// Reconcile reconciles the [extensionsv1alpha1.DNSRecord] resource.
//
// Implementations should ensure that DNS records are created or updated
// in order to reach their desired state.
Reconcile(context.Context, logr.Logger, *extensionsv1alpha1.DNSRecord, *extensionscontroller.Cluster) error
// Delete is invoked when the [extensionsv1alpha1.DNSRecord] resource is
// deleted.
//
// Implementations should take care of cleaning up any DNS records, and
// any other related resources, which the extension has created as part
// of its lifecycle.
//
// Implementations must wait until all resources managed by the
// extension have been gracefully cleaned up.
Delete(context.Context, logr.Logger, *extensionsv1alpha1.DNSRecord, *extensionscontroller.Cluster) error
// ForceDelete is invoked when the shoot cluster associated with the
// [extensionsv1alpha1.DNSRecord] resource is being deleted in a
// forceful manner.
//
// Implementations should take care of unblocking the deletion flow by
// attempting to cleanup any resources created by the extension, remove
// any finalizers created for custom resources, and also skip waiting
// for external resources (e.g. DNS records), if they cannot be deleted
// gracefully.
//
// If some resources managed by the extension implementation cannot be
// deleted gracefully, this method should still succeed, even if some
// resources are orphaned.
ForceDelete(context.Context, logr.Logger, *extensionsv1alpha1.DNSRecord, *extensionscontroller.Cluster) error
// Restore restores the [exensionsv1alpha1.DNSRecord] resource from a
// previously saved state.
//
// This method is invoked when the shoot cluster associated with the
// [extensionsv1alpha1.DNSRecord] resource is being restored on the
// target seed cluster.
//
// Implementations may use the persisted data in the .status.state field
// for restoring the state, when the shoot is being migrated to a
// different seed cluster.
Restore(context.Context, logr.Logger, *extensionsv1alpha1.DNSRecord, *extensionscontroller.Cluster) error
// Migrate prepares the [extensionsv1alpha1.DNSRecord] resource for
// migration.
//
// This method is invoked when the shoot cluster associated with the
// [extensionsv1alpha1.DNSRecord] resource is being migrated to another
// seed cluster.
//
// Implementations should take care of storing any required state in the
// .status.state field, so that it can later be restored from this
// state.
Migrate(context.Context, logr.Logger, *extensionsv1alpha1.DNSRecord, *extensionscontroller.Cluster) error
}
Actuator acts upon extensionsv1alpha1.DNSRecord resources.
type AddArgs ¶
type AddArgs struct {
// Actuator is a DNSRecord actuator.
Actuator Actuator
// ControllerOptions are the controller options used for creating a controller.
// The options.Reconciler is always overridden with a reconciler created from the
// given actuator.
ControllerOptions controller.Options
// Predicates are the predicates to use.
// If unset, GenerationChangedPredicate will be used.
Predicates []predicate.Predicate
// Type is the type of the resource considered for reconciliation.
Type string
// IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
// If the annotation is not ignored, the extension controller will only reconcile
// with a present operation annotation typically set during a reconcile (e.g in the maintenance time) by the Gardenlet
IgnoreOperationAnnotation bool
// ExtensionClasses defines the extension classes this controller is responsible for.
ExtensionClasses []extensionsv1alpha1.ExtensionClass
}
AddArgs are arguments for adding a DNSRecord controller to a manager.