Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ linters:
- linters:
- staticcheck
text: 'SA1019: (clusterv1alpha3.*|clusterv1alpha4.*) is deprecated: This type will be removed in one of the next releases.'
# Specific exclude rules for deprecated feature flags
- linters:
- staticcheck
text: 'SA1019: feature.ClusterResourceSet is deprecated: ClusterResourceSet feature is now GA and the corresponding feature flag will be removed in 1.12 release.'
# v1Beta1 deprecated fields
- linters:
- staticcheck
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
- "--leader-elect"
- "--diagnostics-address=${CAPI_DIAGNOSTICS_ADDRESS:=:8443}"
- "--insecure-diagnostics=${CAPI_INSECURE_DIAGNOSTICS:=false}"
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},ClusterResourceSet=${EXP_CLUSTER_RESOURCE_SET:=true},ClusterTopology=${CLUSTER_TOPOLOGY:=false},RuntimeSDK=${EXP_RUNTIME_SDK:=false},MachineSetPreflightChecks=${EXP_MACHINE_SET_PREFLIGHT_CHECKS:=true},MachineWaitForVolumeDetachConsiderVolumeAttachments=${EXP_MACHINE_WAITFORVOLUMEDETACH_CONSIDER_VOLUMEATTACHMENTS:=true},PriorityQueue=${EXP_PRIORITY_QUEUE:=false},InPlaceUpdates=${EXP_IN_PLACE_UPDATES:=false}"
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},ClusterTopology=${CLUSTER_TOPOLOGY:=false},RuntimeSDK=${EXP_RUNTIME_SDK:=false},MachineSetPreflightChecks=${EXP_MACHINE_SET_PREFLIGHT_CHECKS:=true},MachineWaitForVolumeDetachConsiderVolumeAttachments=${EXP_MACHINE_WAITFORVOLUMEDETACH_CONSIDER_VOLUMEATTACHMENTS:=true},PriorityQueue=${EXP_PRIORITY_QUEUE:=false},InPlaceUpdates=${EXP_IN_PLACE_UPDATES:=false}"
image: controller:latest
name: manager
env:
Expand Down
6 changes: 0 additions & 6 deletions docs/book/src/tasks/cluster-resource-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
The `ClusterResourceSet` feature is introduced to provide a way to automatically apply a set of resources (such as CNI/CSI) defined by users to matching newly-created/existing clusters.
`ClusterResourceSet` provides a basic solution for installing & managing resources, while for advanced use cases an addon provider must be used.

**Feature gate name**: `ClusterResourceSet`

**Variable name to enable/disable the feature gate**: `EXP_CLUSTER_RESOURCE_SET`

The `ClusterResourceSet` feature is now GA and is enabled by default, but can be disabled by setting the `EXP_CLUSTER_RESOURCE_SET` environment variable to `false`.

More details on `ClusterResourceSet` can be found at:
[ClusterResourceSet CAEP](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20200220-cluster-resource-set.md)

Expand Down
10 changes: 0 additions & 10 deletions feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ const (
// beta: v1.7
MachinePool featuregate.Feature = "MachinePool"

// ClusterResourceSet is a feature gate for the ClusterResourceSet functionality.
//
// alpha: v0.3
// beta: v0.4
// GA: v1.10
//
// Deprecated: ClusterResourceSet feature is now GA and the corresponding feature flag will be removed in 1.12 release.
ClusterResourceSet featuregate.Feature = "ClusterResourceSet"

// ClusterTopology is a feature gate for the ClusterClass and managed topologies functionality.
//
// alpha: v0.4
Expand Down Expand Up @@ -91,7 +82,6 @@ func init() {
// To add a new feature, define a key for it above and add it here.
var defaultClusterAPIFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
// Every feature should be initiated here:
ClusterResourceSet: {Default: true, PreRelease: featuregate.GA},
MachinePool: {Default: true, PreRelease: featuregate.Beta},
MachineSetPreflightChecks: {Default: true, PreRelease: featuregate.Beta},
MachineWaitForVolumeDetachConsiderVolumeAttachments: {Default: true, PreRelease: featuregate.Beta},
Expand Down
10 changes: 0 additions & 10 deletions internal/webhooks/clusterresourceset.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"

addonsv1 "sigs.k8s.io/cluster-api/api/addons/v1beta2"
"sigs.k8s.io/cluster-api/feature"
)

// ClusterResourceSet implements a validation and defaulting webhook for ClusterResourceSet.
Expand Down Expand Up @@ -93,15 +92,6 @@ func (webhook *ClusterResourceSet) ValidateDelete(_ context.Context, _ runtime.O
func (webhook *ClusterResourceSet) validate(oldCRS, newCRS *addonsv1.ClusterResourceSet) error {
var allErrs field.ErrorList

// NOTE: ClusterResourceSet is behind ClusterResourceSet feature gate flag; the web hook
// must prevent creating new objects when the feature flag is disabled.
if !feature.Gates.Enabled(feature.ClusterResourceSet) {
return field.Forbidden(
field.NewPath("spec"),
"can be set only if the ClusterResourceSet feature flag is enabled",
)
}

// Validate selector parses as Selector
selector, err := metav1.LabelSelectorAsSelector(&newCRS.Spec.ClusterSelector)
if err != nil {
Expand Down
10 changes: 0 additions & 10 deletions internal/webhooks/clusterresourcesetbinding.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"

addonsv1 "sigs.k8s.io/cluster-api/api/addons/v1beta2"
"sigs.k8s.io/cluster-api/feature"
)

func (webhook *ClusterResourceSetBinding) SetupWebhookWithManager(mgr ctrl.Manager) error {
Expand Down Expand Up @@ -75,15 +74,6 @@ func (webhook *ClusterResourceSetBinding) ValidateDelete(_ context.Context, _ ru
func (webhook *ClusterResourceSetBinding) validate(oldCRSB, newCRSB *addonsv1.ClusterResourceSetBinding) error {
var allErrs field.ErrorList

// NOTE: ClusterResourceSet is behind ClusterResourceSet feature gate flag; the web hook
// must prevent creating new objects in case the feature flag is disabled.
if !feature.Gates.Enabled(feature.ClusterResourceSet) {
return field.Forbidden(
field.NewPath("spec"),
"can be set only if the ClusterResourceSet feature flag is enabled",
)
}

if oldCRSB != nil && oldCRSB.Spec.ClusterName != "" && oldCRSB.Spec.ClusterName != newCRSB.Spec.ClusterName {
allErrs = append(allErrs,
field.Invalid(field.NewPath("spec", "clusterName"), newCRSB.Spec.ClusterName, "field is immutable"))
Expand Down
30 changes: 14 additions & 16 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,22 +731,20 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, watchNamespaces map
}
}

if feature.Gates.Enabled(feature.ClusterResourceSet) {
if err := (&controllers.ClusterResourceSetReconciler{
Client: mgr.GetClient(),
ClusterCache: clusterCache,
WatchFilterValue: watchFilterValue,
}).SetupWithManager(ctx, mgr, concurrency(clusterResourceSetConcurrency), partialSecretCache); err != nil {
setupLog.Error(err, "Unable to create controller", "controller", "ClusterResourceSet")
os.Exit(1)
}
if err := (&controllers.ClusterResourceSetBindingReconciler{
Client: mgr.GetClient(),
WatchFilterValue: watchFilterValue,
}).SetupWithManager(ctx, mgr, concurrency(clusterResourceSetConcurrency)); err != nil {
setupLog.Error(err, "Unable to create controller", "controller", "ClusterResourceSetBinding")
os.Exit(1)
}
if err := (&controllers.ClusterResourceSetReconciler{
Client: mgr.GetClient(),
ClusterCache: clusterCache,
WatchFilterValue: watchFilterValue,
}).SetupWithManager(ctx, mgr, concurrency(clusterResourceSetConcurrency), partialSecretCache); err != nil {
setupLog.Error(err, "Unable to create controller", "controller", "ClusterResourceSet")
os.Exit(1)
}
if err := (&controllers.ClusterResourceSetBindingReconciler{
Client: mgr.GetClient(),
WatchFilterValue: watchFilterValue,
}).SetupWithManager(ctx, mgr, concurrency(clusterResourceSetConcurrency)); err != nil {
setupLog.Error(err, "Unable to create controller", "controller", "ClusterResourceSetBinding")
os.Exit(1)
}

if err := (&controllers.MachineHealthCheckReconciler{
Expand Down