Documentation
¶
Index ¶
Constants ¶
View Source
const ( // FinalizerName is the bastion controller finalizer. FinalizerName = "extensions.gardener.cloud/bastion" // ControllerName is the name of the controller ControllerName = "bastion" )
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add creates a new Bastion Controller and adds it to the Manager. and Start it when the Manager is Started.
func DefaultPredicates ¶
DefaultPredicates returns the default predicates for a bastion reconciler.
func NewReconciler ¶
func NewReconciler(mgr manager.Manager, actuator Actuator, configValidator ConfigValidator) reconcile.Reconciler
NewReconciler creates a new reconcile.Reconciler that reconciles bastion resources of Gardener's `extensions.gardener.cloud` API group.
Types ¶
type Actuator ¶
type Actuator interface {
// Reconcile reconciles the [extensionsv1alpha1.Bastion] resource.
//
// Implementations should ensure that the bastion host is created or
// updated in order to reach its desired state.
Reconcile(context.Context, logr.Logger, *extensionsv1alpha1.Bastion, *extensionscontroller.Cluster) error
// Delete is invoked when the [extensionsv1alpha1.Bastion] resource is
// deleted.
//
// Implementations should take care of cleaning up any resources created
// by the extension during its lifecycle.
//
// Implementations must wait until all resources managed by the
// extension have been gracefully cleaned up.
Delete(context.Context, logr.Logger, *extensionsv1alpha1.Bastion, *extensionscontroller.Cluster) error
// ForceDelete is invoked when the [extensionsv1alpha1.Bastion] 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, and
// also skip waiting for external resources, 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.Bastion, *extensionscontroller.Cluster) error
}
Actuator acts upon extensionsv1alpha1.Bastion resources.
type AddArgs ¶
type AddArgs struct {
// Actuator is a Bastion actuator.
Actuator Actuator
// ConfigValidator is a bastion config validator.
ConfigValidator ConfigValidator
// 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
// ExtensionClasses defines the extension classes this controller is responsible for.
ExtensionClasses []extensionsv1alpha1.ExtensionClass
}
AddArgs are arguments for adding a Bastion controller to a manager.
type ConfigValidator ¶ added in v1.51.0
type ConfigValidator interface {
// Validate validates the provider config of the given bastion and cluster resources used by Bastion.
// If the returned error list is non-empty, the reconciliation will fail with an error.
// This error will have the error code ERR_CONFIGURATION_PROBLEM, unless there is at least one error in the list
// that has its ErrorType field set to field.ErrorTypeInternal.
Validate(ctx context.Context, bastion *extensionsv1alpha1.Bastion, cluster *extensions.Cluster) field.ErrorList
}
ConfigValidator validates the provider config of bastion resource with the cloud provider.
Click to show internal directories.
Click to hide internal directories.