Skip to content

Commit fa597bf

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

File tree

5 files changed

+2
-50
lines changed

5 files changed

+2
-50
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

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: 1 addition & 9 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,14 +92,7 @@ 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-
}
95+
// NOTE: The "if !feature.Gates.Enabled(feature.ClusterResourceSet)" block has been removed.
10496

10597
// Validate selector parses as Selector
10698
selector, err := metav1.LabelSelectorAsSelector(&newCRS.Spec.ClusterSelector)

internal/webhooks/clusterresourcesetbinding.go

Lines changed: 1 addition & 9 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,14 +74,7 @@ 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-
}
77+
// NOTE: The entire "if !feature.Gates.Enabled(feature.ClusterResourceSet)" block has been removed.
8678

8779
if oldCRSB != nil && oldCRSB.Spec.ClusterName != "" && oldCRSB.Spec.ClusterName != newCRSB.Spec.ClusterName {
8880
allErrs = append(allErrs,

main.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -731,24 +731,6 @@ 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-
}
750-
}
751-
752734
if err := (&controllers.MachineHealthCheckReconciler{
753735
Client: mgr.GetClient(),
754736
ClusterCache: clusterCache,

0 commit comments

Comments
 (0)