Skip to content

Commit

Permalink
Graduate JobTrackingWithFinalizers to beta
Browse files Browse the repository at this point in the history
Enable feature by default.

Update integration tests for other features to assume that finalizers are present.

Change-Id: Ie969344f572627dba882c0e862e5700dadaf3026
  • Loading branch information
alculquicondor committed Oct 15, 2021
1 parent c2bff66 commit 2c1b3fd
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pkg/apis/batch/types.go
Expand Up @@ -274,8 +274,9 @@ type JobStatus struct {
// (3) Remove the pod UID from the array while increasing the corresponding
// counter.
//
// This field is alpha-level. The job controller only makes use of this field
// when the feature gate JobTrackingWithFinalizers is enabled.
// This field is beta-level. The job controller only makes use of this field
// when the feature gate JobTrackingWithFinalizers is enabled (enabled
// by default).
// Old jobs might not be tracked using this field, in which case the field
// remains null.
// +optional
Expand Down
3 changes: 2 additions & 1 deletion pkg/features/kube_features.go
Expand Up @@ -223,6 +223,7 @@ const (

// owner: @alculquicondor
// alpha: v1.22
// beta: v1.23
//
// Track Job completion without relying on Pod remaining in the cluster
// indefinitely. Pod finalizers, in addition to a field in the Job status
Expand Down Expand Up @@ -826,7 +827,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
ProcMountType: {Default: false, PreRelease: featuregate.Alpha},
TTLAfterFinished: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25
IndexedJob: {Default: true, PreRelease: featuregate.Beta},
JobTrackingWithFinalizers: {Default: false, PreRelease: featuregate.Alpha},
JobTrackingWithFinalizers: {Default: true, PreRelease: featuregate.Beta},
KubeletPodResources: {Default: true, PreRelease: featuregate.Beta},
LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha},
NonPreemptingPriority: {Default: true, PreRelease: featuregate.Beta},
Expand Down
5 changes: 3 additions & 2 deletions staging/src/k8s.io/api/batch/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions staging/src/k8s.io/api/batch/v1/types.go
Expand Up @@ -258,8 +258,9 @@ type JobStatus struct {
// (3) Remove the pod UID from the arrays while increasing the corresponding
// counter.
//
// This field is alpha-level. The job controller only makes use of this field
// when the feature gate JobTrackingWithFinalizers is enabled.
// This field is beta-level. The job controller only makes use of this field
// when the feature gate JobTrackingWithFinalizers is enabled (enabled
// by default).
// Old jobs might not be tracked using this field, in which case the field
// remains null.
// +optional
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions test/integration/job/job_test.go
Expand Up @@ -569,7 +569,7 @@ func TestSuspendJob(t *testing.T) {
validate := func(s string, active int, status v1.ConditionStatus, reason string) {
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
Active: active,
}, false)
}, true)
job, err = clientSet.BatchV1().Jobs(ns.Name).Get(ctx, job.Name, metav1.GetOptions{})
if err != nil {
t.Fatalf("Failed to get Job after %s: %v", s, err)
Expand Down Expand Up @@ -615,7 +615,7 @@ func TestSuspendJobControllerRestart(t *testing.T) {
}
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
Active: 0,
}, false)
}, true)

// Disable feature gate and restart controller to test that pods get created.
defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.SuspendJob, false)()
Expand All @@ -627,7 +627,7 @@ func TestSuspendJobControllerRestart(t *testing.T) {
}
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
Active: 2,
}, false)
}, true)
}

func TestNodeSelectorUpdate(t *testing.T) {
Expand Down

0 comments on commit 2c1b3fd

Please sign in to comment.