diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 60f255edd13..9585ab8424b 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -4587,7 +4587,7 @@ "type": "integer" }, "managedBy": { - "description": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.\n\nThis field is beta-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (enabled by default).", + "description": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.", "type": "string" }, "manualSelector": { diff --git a/api/openapi-spec/v3/apis__batch__v1_openapi.json b/api/openapi-spec/v3/apis__batch__v1_openapi.json index 738483b2f8e..3f586fcf383 100644 --- a/api/openapi-spec/v3/apis__batch__v1_openapi.json +++ b/api/openapi-spec/v3/apis__batch__v1_openapi.json @@ -345,7 +345,7 @@ "type": "integer" }, "managedBy": { - "description": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.\n\nThis field is beta-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (enabled by default).", + "description": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.", "type": "string" }, "manualSelector": { diff --git a/pkg/apis/batch/types.go b/pkg/apis/batch/types.go index b6678e5dd69..5fb3d8f8233 100644 --- a/pkg/apis/batch/types.go +++ b/pkg/apis/batch/types.go @@ -467,9 +467,6 @@ type JobSpec struct { // by RFC 1123. All characters trailing the first "/" must be valid HTTP Path // characters as defined by RFC 3986. The value cannot exceed 63 characters. // This field is immutable. - // - // This field is beta-level. The job controller accepts setting the field - // when the feature gate JobManagedBy is enabled (enabled by default). // +optional ManagedBy *string } diff --git a/pkg/controller/job/job_controller_test.go b/pkg/controller/job/job_controller_test.go index bad6c63984a..a580b80b768 100644 --- a/pkg/controller/job/job_controller_test.go +++ b/pkg/controller/job/job_controller_test.go @@ -2690,6 +2690,9 @@ func TestSyncJobPastDeadline(t *testing.T) { if !tc.enableJobPodReplacementPolicy { // TODO: this will be removed in 1.37. featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.33")) + } else if !tc.enableJobManagedBy { + // TODO: this will be removed in 1.38. + featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.34")) } featuregatetesting.SetFeatureGatesDuringTest(t, feature.DefaultFeatureGate, featuregatetesting.FeatureOverrides{ features.JobManagedBy: tc.enableJobManagedBy, @@ -3022,6 +3025,8 @@ func TestSyncJobWhenManagedBy(t *testing.T) { } for name, tc := range testCases { t.Run(name, func(t *testing.T) { + // TODO: this will be removed in 1.38. + featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.34")) featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.JobManagedBy, tc.enableJobManagedBy) clientset := clientset.NewForConfigOrDie(&restclient.Config{Host: "", ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) @@ -5184,6 +5189,9 @@ func TestSyncJobWithJobSuccessPolicy(t *testing.T) { if !tc.enableBackoffLimitPerIndex || !tc.enableJobSuccessPolicy { // TODO: this will be removed in 1.36 featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.32")) + } else if !tc.enableJobManagedBy { + // TODO: this will be remove in 1.38 + featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.34")) } featuregatetesting.SetFeatureGatesDuringTest(t, feature.DefaultFeatureGate, featuregatetesting.FeatureOverrides{ features.JobBackoffLimitPerIndex: tc.enableBackoffLimitPerIndex, @@ -5871,6 +5879,9 @@ func TestSyncJobWithJobBackoffLimitPerIndex(t *testing.T) { } else if !tc.enableJobPodReplacementPolicy { // TODO: this will be removed in 1.37. featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.33")) + } else if !tc.enableJobManagedBy { + // TODO: this will be removed in 1.38. + featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.34")) } featuregatetesting.SetFeatureGatesDuringTest(t, feature.DefaultFeatureGate, featuregatetesting.FeatureOverrides{ features.JobBackoffLimitPerIndex: tc.enableJobBackoffLimitPerIndex, @@ -7378,6 +7389,9 @@ func TestJobBackoffForOnFailure(t *testing.T) { if !tc.enableJobPodReplacementPolicy { // TODO: this will be removed in 1.37. featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.33")) + } else if !tc.enableJobManagedBy { + // TODO: this will be removed in 1.38. + featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.34")) } featuregatetesting.SetFeatureGatesDuringTest(t, feature.DefaultFeatureGate, featuregatetesting.FeatureOverrides{ features.JobPodReplacementPolicy: tc.enableJobPodReplacementPolicy, diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index 463c6e7428f..ccae24f8dfa 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -1301,6 +1301,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate JobManagedBy: { {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.35"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.38 }, JobPodReplacementPolicy: { diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 336d82f28ce..97987042a7c 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -18412,7 +18412,7 @@ func schema_k8sio_api_batch_v1_JobSpec(ref common.ReferenceCallback) common.Open }, "managedBy": { SchemaProps: spec.SchemaProps{ - Description: "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.\n\nThis field is beta-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (enabled by default).", + Description: "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.", Type: []string{"string"}, Format: "", }, diff --git a/staging/src/k8s.io/api/batch/v1/generated.proto b/staging/src/k8s.io/api/batch/v1/generated.proto index 3034fd262c4..ca8248ff5b6 100644 --- a/staging/src/k8s.io/api/batch/v1/generated.proto +++ b/staging/src/k8s.io/api/batch/v1/generated.proto @@ -342,9 +342,6 @@ message JobSpec { // by RFC 1123. All characters trailing the first "/" must be valid HTTP Path // characters as defined by RFC 3986. The value cannot exceed 63 characters. // This field is immutable. - // - // This field is beta-level. The job controller accepts setting the field - // when the feature gate JobManagedBy is enabled (enabled by default). // +optional optional string managedBy = 15; } diff --git a/staging/src/k8s.io/api/batch/v1/types.go b/staging/src/k8s.io/api/batch/v1/types.go index 8ad837f7c1b..26d0ee6dc4a 100644 --- a/staging/src/k8s.io/api/batch/v1/types.go +++ b/staging/src/k8s.io/api/batch/v1/types.go @@ -469,9 +469,6 @@ type JobSpec struct { // by RFC 1123. All characters trailing the first "/" must be valid HTTP Path // characters as defined by RFC 3986. The value cannot exceed 63 characters. // This field is immutable. - // - // This field is beta-level. The job controller accepts setting the field - // when the feature gate JobManagedBy is enabled (enabled by default). // +optional ManagedBy *string `json:"managedBy,omitempty" protobuf:"bytes,15,opt,name=managedBy"` } diff --git a/staging/src/k8s.io/api/batch/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/batch/v1/types_swagger_doc_generated.go index 451f4609f2d..267df429266 100644 --- a/staging/src/k8s.io/api/batch/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/batch/v1/types_swagger_doc_generated.go @@ -127,7 +127,7 @@ var map_JobSpec = map[string]string{ "completionMode": "completionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nMore completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, which is possible during upgrades due to version skew, the controller skips updates for the Job.", "suspend": "suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.", "podReplacementPolicy": "podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods\n when they are terminating (has a metadata.deletionTimestamp) or failed.\n- Failed means to wait until a previously created Pod is fully terminated (has phase\n Failed or Succeeded) before creating a replacement Pod.\n\nWhen using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.", - "managedBy": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.\n\nThis field is beta-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (enabled by default).", + "managedBy": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.", } func (JobSpec) SwaggerDoc() map[string]string { diff --git a/staging/src/k8s.io/client-go/applyconfigurations/batch/v1/jobspec.go b/staging/src/k8s.io/client-go/applyconfigurations/batch/v1/jobspec.go index 6018a903b71..81064df751a 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/batch/v1/jobspec.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/batch/v1/jobspec.go @@ -159,9 +159,6 @@ type JobSpecApplyConfiguration struct { // by RFC 1123. All characters trailing the first "/" must be valid HTTP Path // characters as defined by RFC 3986. The value cannot exceed 63 characters. // This field is immutable. - // - // This field is beta-level. The job controller accepts setting the field - // when the feature gate JobManagedBy is enabled (enabled by default). ManagedBy *string `json:"managedBy,omitempty"` } diff --git a/test/compatibility_lifecycle/reference/versioned_feature_list.yaml b/test/compatibility_lifecycle/reference/versioned_feature_list.yaml index 7e9d160765d..27c5129a008 100644 --- a/test/compatibility_lifecycle/reference/versioned_feature_list.yaml +++ b/test/compatibility_lifecycle/reference/versioned_feature_list.yaml @@ -725,6 +725,10 @@ lockToDefault: false preRelease: Beta version: "1.32" + - default: true + lockToDefault: true + preRelease: GA + version: "1.35" - name: JobPodReplacementPolicy versionedSpecs: - default: false diff --git a/test/integration/job/job_test.go b/test/integration/job/job_test.go index 24bbd002ab3..cfc7d212746 100644 --- a/test/integration/job/job_test.go +++ b/test/integration/job/job_test.go @@ -1593,6 +1593,9 @@ func TestDelayTerminalPhaseCondition(t *testing.T) { } else if !test.enableJobPodReplacementPolicy { // TODO: this will be removed in 1.37. featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.33")) + } else if !test.enableJobManagedBy { + // TODO: this will be removed in 1.38. + featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.34")) } featuregatetesting.SetFeatureGatesDuringTest(t, feature.DefaultFeatureGate, featuregatetesting.FeatureOverrides{ features.JobPodReplacementPolicy: test.enableJobPodReplacementPolicy, @@ -2150,6 +2153,8 @@ func TestManagedBy(t *testing.T) { for name, test := range testCases { t.Run(name, func(t *testing.T) { resetMetrics() + // TODO: this will be removed in 1.38. + featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.34")) featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.JobManagedBy, test.enableJobManagedBy) ctx, cancel := startJobControllerAndWaitForCaches(t, restConfig) @@ -2197,6 +2202,8 @@ func TestManagedBy(t *testing.T) { // and is disabled again with re-enabling of the feature gate. func TestManagedBy_Reenabling(t *testing.T) { customControllerName := "example.com/custom-job-controller" + // TODO: this will be removed in 1.38. + featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, utilversion.MustParse("1.34")) featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.JobManagedBy, true) closeFn, restConfig, clientSet, ns := setup(t, "managed-by-reenabling")