Documentation ¶
Index ¶
- Constants
- Variables
- func Add(mgr manager.Manager, args AddArgs) error
- func CheckCSIConditions(cluster *extensionscontroller.Cluster, csiMigrationVersion string) (useCSI bool, csiMigrationComplete bool, err error)
- func ClusterCSIMigrationControllerNotFinished() predicate.Predicate
- func NewReconciler(csiMigrationKubernetesVersion string, ...) reconcile.Reconciler
- type AddArgs
Constants ¶
const ( // ControllerName is the name of the controller ControllerName = "csimigration_controller" // AnnotationKeyNeedsComplete is a constant for an annotation on the Cluster resource that indicates that // the control plane components require the CSIMigration<Provider>Complete feature gates. AnnotationKeyNeedsComplete = "csi-migration.extensions.gardener.cloud/needs-complete-feature-gates" // AnnotationKeyControllerFinished is a constant for an annotation on the Cluster resource that indicates that // the CSI migration has nothing more to do anymore because he completed earlier already. AnnotationKeyControllerFinished = "csi-migration.extensions.gardener.cloud/controller-finished" )
const RequeueAfter = time.Minute
RequeueAfter is the duration to requeue a Cluster reconciliation if indicated by the CSI controller.
Variables ¶
var NewClientForShoot = util.NewClientForShoot
NewClientForShoot is a function to create a new client for shoots.
Functions ¶
func Add ¶
Add creates a new CSIMigration Controller and adds it to the Manager. and Start it when the Manager is Started.
func CheckCSIConditions ¶
func CheckCSIConditions(cluster *extensionscontroller.Cluster, csiMigrationVersion string) (useCSI bool, csiMigrationComplete bool, err error)
CheckCSIConditions takes the `Cluster` object and the Kubernetes version that shall be used for CSI migration. It returns two booleans - the first one indicates whether CSI shall be used at all (this may help the provider extension to decide whether to enable CSIMigration feature gates), and the second one indicates whether the CSI migration has been completed (this may help the provider extension to decide whether to enable the CSIMigration<Provider>Complete feature gate). If the shoot cluster version is higher than the CSI migration version then it always returns true for both variables. If it's lower than the CSI migration version then it always returns false for both variables. If it's the exact CSI migration (minor) version then it returns true for the first value (CSI migration shall be enabled), and true or false based on whether the "needs-complete-feature-gates" annotation is set on the Cluster object.
func ClusterCSIMigrationControllerNotFinished ¶
ClusterCSIMigrationControllerNotFinished is a predicate for an annotation on the cluster.
func NewReconciler ¶
func NewReconciler(csiMigrationKubernetesVersion string, storageClassNameToLegacyProvisioner map[string]string) reconcile.Reconciler
NewReconciler creates a new reconcile.Reconciler that reconciles Cluster resources of Gardener's `extensions.gardener.cloud` API group.
Types ¶
type AddArgs ¶
type AddArgs struct { // 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. Predicates []predicate.Predicate // CSIMigrationKubernetesVersion is the smallest Kubernetes version that is used for the CSI migration. CSIMigrationKubernetesVersion string // Type is the provider extension type. Type string // StorageClassNameToLegacyProvisioner is a map of storage class names to the used legacy provisioner name. As part // of the CSI migration they will be deleted so that new storage classes with the same name but a different CSI // provisioner can be created (storage classes are immutable). StorageClassNameToLegacyProvisioner map[string]string }
AddArgs are arguments for adding an csimigration controller to a manager.