Merge pull request #112748 from wojtek-t/lock_ssa_gate
Lock ServerSideApply feature to true
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"k8s.io/apiserver/pkg/features"
|
||||
rbacv1ac "k8s.io/client-go/applyconfigurations/rbac/v1"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
@@ -33,7 +32,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
rbacinformers "k8s.io/client-go/informers/rbac/v1"
|
||||
rbacclient "k8s.io/client-go/kubernetes/typed/rbac/v1"
|
||||
rbaclisters "k8s.io/client-go/listers/rbac/v1"
|
||||
@@ -125,16 +123,12 @@ func (c *ClusterRoleAggregationController) syncClusterRole(ctx context.Context,
|
||||
return nil
|
||||
}
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.ServerSideApply) {
|
||||
err = c.applyClusterRoles(ctx, sharedClusterRole.Name, newPolicyRules)
|
||||
if errors.IsUnsupportedMediaType(err) { // TODO: Remove this fallback at least one release after ServerSideApply GA
|
||||
// When Server Side Apply is not enabled, fallback to Update. This is required when running
|
||||
// 1.21 since api-server can be 1.20 during the upgrade/downgrade.
|
||||
// Since Server Side Apply is enabled by default in Beta, this fallback only kicks in
|
||||
// if the feature has been disabled using its feature flag.
|
||||
err = c.updateClusterRoles(ctx, sharedClusterRole, newPolicyRules)
|
||||
}
|
||||
} else {
|
||||
err = c.applyClusterRoles(ctx, sharedClusterRole.Name, newPolicyRules)
|
||||
if errors.IsUnsupportedMediaType(err) { // TODO: Remove this fallback at least one release after ServerSideApply GA
|
||||
// When Server Side Apply is not enabled, fallback to Update. This is required when running
|
||||
// 1.21 since api-server can be 1.20 during the upgrade/downgrade.
|
||||
// Since Server Side Apply is enabled by default in Beta, this fallback only kicks in
|
||||
// if the feature has been disabled using its feature flag.
|
||||
err = c.updateClusterRoles(ctx, sharedClusterRole, newPolicyRules)
|
||||
}
|
||||
return err
|
||||
|
@@ -1034,7 +1034,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
||||
|
||||
genericfeatures.OpenAPIV3: {Default: true, PreRelease: featuregate.Beta},
|
||||
|
||||
genericfeatures.ServerSideApply: {Default: true, PreRelease: featuregate.GA},
|
||||
genericfeatures.ServerSideApply: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29
|
||||
|
||||
genericfeatures.ServerSideFieldValidation: {Default: true, PreRelease: featuregate.Beta},
|
||||
|
||||
|
Reference in New Issue
Block a user