Skip to content

Commit 46de674

Browse files
committed
🌱 Remove deprecated ClusterResourceSet feature gate
1 parent 4d7fffc commit 46de674

File tree

7 files changed

+15
-57
lines changed

7 files changed

+15
-57
lines changed

.golangci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,6 @@ linters:
261261
- linters:
262262
- staticcheck
263263
text: 'SA1019: (clusterv1alpha3.*|clusterv1alpha4.*) is deprecated: This type will be removed in one of the next releases.'
264-
# Specific exclude rules for deprecated feature flags
265-
- linters:
266-
- staticcheck
267-
text: 'SA1019: feature.ClusterResourceSet is deprecated: ClusterResourceSet feature is now GA and the corresponding feature flag will be removed in 1.12 release.'
268264
# v1Beta1 deprecated fields
269265
- linters:
270266
- staticcheck

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
- "--leader-elect"
2424
- "--diagnostics-address=${CAPI_DIAGNOSTICS_ADDRESS:=:8443}"
2525
- "--insecure-diagnostics=${CAPI_INSECURE_DIAGNOSTICS:=false}"
26-
- "--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}"
26+
- "--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}"
2727
image: controller:latest
2828
name: manager
2929
env:

docs/book/src/tasks/cluster-resource-set.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
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.
44
`ClusterResourceSet` provides a basic solution for installing & managing resources, while for advanced use cases an addon provider must be used.
55

6-
**Feature gate name**: `ClusterResourceSet`
7-
8-
**Variable name to enable/disable the feature gate**: `EXP_CLUSTER_RESOURCE_SET`
9-
10-
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`.
11-
126
More details on `ClusterResourceSet` can be found at:
137
[ClusterResourceSet CAEP](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20200220-cluster-resource-set.md)
148

feature/feature.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ const (
3535
// beta: v1.7
3636
MachinePool featuregate.Feature = "MachinePool"
3737

38-
// ClusterResourceSet is a feature gate for the ClusterResourceSet functionality.
39-
//
40-
// alpha: v0.3
41-
// beta: v0.4
42-
// GA: v1.10
43-
//
44-
// Deprecated: ClusterResourceSet feature is now GA and the corresponding feature flag will be removed in 1.12 release.
45-
ClusterResourceSet featuregate.Feature = "ClusterResourceSet"
46-
4738
// ClusterTopology is a feature gate for the ClusterClass and managed topologies functionality.
4839
//
4940
// alpha: v0.4
@@ -91,7 +82,6 @@ func init() {
9182
// To add a new feature, define a key for it above and add it here.
9283
var defaultClusterAPIFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
9384
// Every feature should be initiated here:
94-
ClusterResourceSet: {Default: true, PreRelease: featuregate.GA},
9585
MachinePool: {Default: true, PreRelease: featuregate.Beta},
9686
MachineSetPreflightChecks: {Default: true, PreRelease: featuregate.Beta},
9787
MachineWaitForVolumeDetachConsiderVolumeAttachments: {Default: true, PreRelease: featuregate.Beta},

internal/webhooks/clusterresourceset.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
3131

3232
addonsv1 "sigs.k8s.io/cluster-api/api/addons/v1beta2"
33-
"sigs.k8s.io/cluster-api/feature"
3433
)
3534

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

96-
// NOTE: ClusterResourceSet is behind ClusterResourceSet feature gate flag; the web hook
97-
// must prevent creating new objects when the feature flag is disabled.
98-
if !feature.Gates.Enabled(feature.ClusterResourceSet) {
99-
return field.Forbidden(
100-
field.NewPath("spec"),
101-
"can be set only if the ClusterResourceSet feature flag is enabled",
102-
)
103-
}
104-
10595
// Validate selector parses as Selector
10696
selector, err := metav1.LabelSelectorAsSelector(&newCRS.Spec.ClusterSelector)
10797
if err != nil {

internal/webhooks/clusterresourcesetbinding.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2929

3030
addonsv1 "sigs.k8s.io/cluster-api/api/addons/v1beta2"
31-
"sigs.k8s.io/cluster-api/feature"
3231
)
3332

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

78-
// NOTE: ClusterResourceSet is behind ClusterResourceSet feature gate flag; the web hook
79-
// must prevent creating new objects in case the feature flag is disabled.
80-
if !feature.Gates.Enabled(feature.ClusterResourceSet) {
81-
return field.Forbidden(
82-
field.NewPath("spec"),
83-
"can be set only if the ClusterResourceSet feature flag is enabled",
84-
)
85-
}
86-
8777
if oldCRSB != nil && oldCRSB.Spec.ClusterName != "" && oldCRSB.Spec.ClusterName != newCRSB.Spec.ClusterName {
8878
allErrs = append(allErrs,
8979
field.Invalid(field.NewPath("spec", "clusterName"), newCRSB.Spec.ClusterName, "field is immutable"))

main.go

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -731,22 +731,20 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, watchNamespaces map
731731
}
732732
}
733733

734-
if feature.Gates.Enabled(feature.ClusterResourceSet) {
735-
if err := (&controllers.ClusterResourceSetReconciler{
736-
Client: mgr.GetClient(),
737-
ClusterCache: clusterCache,
738-
WatchFilterValue: watchFilterValue,
739-
}).SetupWithManager(ctx, mgr, concurrency(clusterResourceSetConcurrency), partialSecretCache); err != nil {
740-
setupLog.Error(err, "Unable to create controller", "controller", "ClusterResourceSet")
741-
os.Exit(1)
742-
}
743-
if err := (&controllers.ClusterResourceSetBindingReconciler{
744-
Client: mgr.GetClient(),
745-
WatchFilterValue: watchFilterValue,
746-
}).SetupWithManager(ctx, mgr, concurrency(clusterResourceSetConcurrency)); err != nil {
747-
setupLog.Error(err, "Unable to create controller", "controller", "ClusterResourceSetBinding")
748-
os.Exit(1)
749-
}
734+
if err := (&controllers.ClusterResourceSetReconciler{
735+
Client: mgr.GetClient(),
736+
ClusterCache: clusterCache,
737+
WatchFilterValue: watchFilterValue,
738+
}).SetupWithManager(ctx, mgr, concurrency(clusterResourceSetConcurrency), partialSecretCache); err != nil {
739+
setupLog.Error(err, "Unable to create controller", "controller", "ClusterResourceSet")
740+
os.Exit(1)
741+
}
742+
if err := (&controllers.ClusterResourceSetBindingReconciler{
743+
Client: mgr.GetClient(),
744+
WatchFilterValue: watchFilterValue,
745+
}).SetupWithManager(ctx, mgr, concurrency(clusterResourceSetConcurrency)); err != nil {
746+
setupLog.Error(err, "Unable to create controller", "controller", "ClusterResourceSetBinding")
747+
os.Exit(1)
750748
}
751749

752750
if err := (&controllers.MachineHealthCheckReconciler{

0 commit comments

Comments
 (0)