Skip to content

Commit 2091174

Browse files
authored
Promote NonPreempt feature gate to beta (kubernetes#91899)
* update nonpreempt featuregate to beta * update
1 parent 850080c commit 2091174

File tree

19 files changed

+30
-20
lines changed

19 files changed

+30
-20
lines changed

api/openapi-spec/swagger.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/testing/defaulting_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ func TestDefaulting(t *testing.T) {
162162
{Group: "storage.k8s.io", Version: "v1beta1", Kind: "VolumeAttachment"}: {},
163163
{Group: "storage.k8s.io", Version: "v1beta1", Kind: "VolumeAttachmentList"}: {},
164164
{Group: "authentication.k8s.io", Version: "v1", Kind: "TokenRequest"}: {},
165+
{Group: "scheduling.k8s.io", Version: "v1alpha1", Kind: "PriorityClass"}: {},
166+
{Group: "scheduling.k8s.io", Version: "v1beta1", Kind: "PriorityClass"}: {},
167+
{Group: "scheduling.k8s.io", Version: "v1", Kind: "PriorityClass"}: {},
168+
{Group: "scheduling.k8s.io", Version: "v1alpha1", Kind: "PriorityClassList"}: {},
169+
{Group: "scheduling.k8s.io", Version: "v1beta1", Kind: "PriorityClassList"}: {},
170+
{Group: "scheduling.k8s.io", Version: "v1", Kind: "PriorityClassList"}: {},
165171
}
166172

167173
f := fuzz.New().NilChance(.5).NumElements(1, 1).RandSource(rand.NewSource(1))

pkg/apis/core/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2731,7 +2731,7 @@ type PodSpec struct {
27312731
// PreemptionPolicy is the Policy for preempting pods with lower priority.
27322732
// One of Never, PreemptLowerPriority.
27332733
// Defaults to PreemptLowerPriority if unset.
2734-
// This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.
2734+
// This field is beta-level, gated by the NonPreemptingPriority feature-gate.
27352735
// +optional
27362736
PreemptionPolicy *PreemptionPolicy
27372737
// Specifies the DNS parameters of a pod.

pkg/apis/scheduling/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type PriorityClass struct {
6969
Description string
7070

7171
// PreemptionPolicy it the Policy for preempting pods with lower priority.
72-
// This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.
72+
// This field is beta-level.
7373
// +optional
7474
PreemptionPolicy *core.PreemptionPolicy
7575
}

pkg/features/kube_features.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ const (
481481

482482
// owner: @denkensk
483483
// alpha: v1.15
484+
// beta: v1.19
484485
//
485486
// Enables NonPreempting option for priorityClass and pod.
486487
NonPreemptingPriority featuregate.Feature = "NonPreemptingPriority"
@@ -674,7 +675,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
674675
WindowsRunAsUserName: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
675676
ServiceLoadBalancerFinalizer: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
676677
LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha},
677-
NonPreemptingPriority: {Default: false, PreRelease: featuregate.Alpha},
678+
NonPreemptingPriority: {Default: true, PreRelease: featuregate.Beta},
678679
VolumePVCDataSource: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
679680
PodOverhead: {Default: true, PreRelease: featuregate.Beta},
680681
IPv6DualStack: {Default: false, PreRelease: featuregate.Alpha},

plugin/pkg/admission/priority/admission.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ func (p *Plugin) admitPod(a admission.Attributes) error {
163163
if pod.Spec.Priority == nil && oldPod.Spec.Priority != nil {
164164
pod.Spec.Priority = oldPod.Spec.Priority
165165
}
166+
if pod.Spec.PreemptionPolicy == nil && oldPod.Spec.PreemptionPolicy != nil {
167+
pod.Spec.PreemptionPolicy = oldPod.Spec.PreemptionPolicy
168+
}
166169
return nil
167170
}
168171

staging/src/k8s.io/api/core/v1/generated.proto

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/api/core/v1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3032,7 +3032,7 @@ type PodSpec struct {
30323032
// PreemptionPolicy is the Policy for preempting pods with lower priority.
30333033
// One of Never, PreemptLowerPriority.
30343034
// Defaults to PreemptLowerPriority if unset.
3035-
// This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.
3035+
// This field is beta-level, gated by the NonPreemptingPriority feature-gate.
30363036
// +optional
30373037
PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,31,opt,name=preemptionPolicy"`
30383038
// Overhead represents the resource overhead associated with running a pod for a given RuntimeClass.

staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/api/scheduling/v1/generated.proto

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)