mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Graduate JobTrackingWithFinalizers to beta
Enable feature by default. Update integration tests for other features to assume that finalizers are present. Change-Id: Ie969344f572627dba882c0e862e5700dadaf3026
This commit is contained in:
parent
c2bff66b95
commit
2c1b3fdb5b
2
api/openapi-spec/swagger.json
generated
2
api/openapi-spec/swagger.json
generated
@ -3671,7 +3671,7 @@
|
|||||||
},
|
},
|
||||||
"uncountedTerminatedPods": {
|
"uncountedTerminatedPods": {
|
||||||
"$ref": "#/definitions/io.k8s.api.batch.v1.UncountedTerminatedPods",
|
"$ref": "#/definitions/io.k8s.api.batch.v1.UncountedTerminatedPods",
|
||||||
"description": "UncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status: (1) Add the pod UID to the arrays in this field. (2) Remove the pod finalizer. (3) Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nThis field is alpha-level. The job controller only makes use of this field when the feature gate JobTrackingWithFinalizers is enabled. Old jobs might not be tracked using this field, in which case the field remains null."
|
"description": "UncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status: (1) Add the pod UID to the arrays in this field. (2) Remove the pod finalizer. (3) Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nThis 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."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
@ -274,8 +274,9 @@ type JobStatus struct {
|
|||||||
// (3) Remove the pod UID from the array while increasing the corresponding
|
// (3) Remove the pod UID from the array while increasing the corresponding
|
||||||
// counter.
|
// counter.
|
||||||
//
|
//
|
||||||
// This field is alpha-level. The job controller only makes use of this field
|
// This field is beta-level. The job controller only makes use of this field
|
||||||
// when the feature gate JobTrackingWithFinalizers is enabled.
|
// when the feature gate JobTrackingWithFinalizers is enabled (enabled
|
||||||
|
// by default).
|
||||||
// Old jobs might not be tracked using this field, in which case the field
|
// Old jobs might not be tracked using this field, in which case the field
|
||||||
// remains null.
|
// remains null.
|
||||||
// +optional
|
// +optional
|
||||||
|
@ -223,6 +223,7 @@ const (
|
|||||||
|
|
||||||
// owner: @alculquicondor
|
// owner: @alculquicondor
|
||||||
// alpha: v1.22
|
// alpha: v1.22
|
||||||
|
// beta: v1.23
|
||||||
//
|
//
|
||||||
// Track Job completion without relying on Pod remaining in the cluster
|
// Track Job completion without relying on Pod remaining in the cluster
|
||||||
// indefinitely. Pod finalizers, in addition to a field in the Job status
|
// indefinitely. Pod finalizers, in addition to a field in the Job status
|
||||||
@ -826,7 +827,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
|||||||
ProcMountType: {Default: false, PreRelease: featuregate.Alpha},
|
ProcMountType: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
TTLAfterFinished: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25
|
TTLAfterFinished: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25
|
||||||
IndexedJob: {Default: true, PreRelease: featuregate.Beta},
|
IndexedJob: {Default: true, PreRelease: featuregate.Beta},
|
||||||
JobTrackingWithFinalizers: {Default: false, PreRelease: featuregate.Alpha},
|
JobTrackingWithFinalizers: {Default: true, PreRelease: featuregate.Beta},
|
||||||
KubeletPodResources: {Default: true, PreRelease: featuregate.Beta},
|
KubeletPodResources: {Default: true, PreRelease: featuregate.Beta},
|
||||||
LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha},
|
LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
NonPreemptingPriority: {Default: true, PreRelease: featuregate.Beta},
|
NonPreemptingPriority: {Default: true, PreRelease: featuregate.Beta},
|
||||||
|
@ -331,8 +331,9 @@ message JobStatus {
|
|||||||
// (3) Remove the pod UID from the arrays while increasing the corresponding
|
// (3) Remove the pod UID from the arrays while increasing the corresponding
|
||||||
// counter.
|
// counter.
|
||||||
//
|
//
|
||||||
// This field is alpha-level. The job controller only makes use of this field
|
// This field is beta-level. The job controller only makes use of this field
|
||||||
// when the feature gate JobTrackingWithFinalizers is enabled.
|
// when the feature gate JobTrackingWithFinalizers is enabled (enabled
|
||||||
|
// by default).
|
||||||
// Old jobs might not be tracked using this field, in which case the field
|
// Old jobs might not be tracked using this field, in which case the field
|
||||||
// remains null.
|
// remains null.
|
||||||
// +optional
|
// +optional
|
||||||
|
@ -258,8 +258,9 @@ type JobStatus struct {
|
|||||||
// (3) Remove the pod UID from the arrays while increasing the corresponding
|
// (3) Remove the pod UID from the arrays while increasing the corresponding
|
||||||
// counter.
|
// counter.
|
||||||
//
|
//
|
||||||
// This field is alpha-level. The job controller only makes use of this field
|
// This field is beta-level. The job controller only makes use of this field
|
||||||
// when the feature gate JobTrackingWithFinalizers is enabled.
|
// when the feature gate JobTrackingWithFinalizers is enabled (enabled
|
||||||
|
// by default).
|
||||||
// Old jobs might not be tracked using this field, in which case the field
|
// Old jobs might not be tracked using this field, in which case the field
|
||||||
// remains null.
|
// remains null.
|
||||||
// +optional
|
// +optional
|
||||||
|
@ -136,7 +136,7 @@ var map_JobStatus = map[string]string{
|
|||||||
"succeeded": "The number of pods which reached phase Succeeded.",
|
"succeeded": "The number of pods which reached phase Succeeded.",
|
||||||
"failed": "The number of pods which reached phase Failed.",
|
"failed": "The number of pods which reached phase Failed.",
|
||||||
"completedIndexes": "CompletedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".",
|
"completedIndexes": "CompletedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".",
|
||||||
"uncountedTerminatedPods": "UncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status: (1) Add the pod UID to the arrays in this field. (2) Remove the pod finalizer. (3) Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nThis field is alpha-level. The job controller only makes use of this field when the feature gate JobTrackingWithFinalizers is enabled. Old jobs might not be tracked using this field, in which case the field remains null.",
|
"uncountedTerminatedPods": "UncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status: (1) Add the pod UID to the arrays in this field. (2) Remove the pod finalizer. (3) Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nThis 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.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (JobStatus) SwaggerDoc() map[string]string {
|
func (JobStatus) SwaggerDoc() map[string]string {
|
||||||
|
@ -569,7 +569,7 @@ func TestSuspendJob(t *testing.T) {
|
|||||||
validate := func(s string, active int, status v1.ConditionStatus, reason string) {
|
validate := func(s string, active int, status v1.ConditionStatus, reason string) {
|
||||||
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
|
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
|
||||||
Active: active,
|
Active: active,
|
||||||
}, false)
|
}, true)
|
||||||
job, err = clientSet.BatchV1().Jobs(ns.Name).Get(ctx, job.Name, metav1.GetOptions{})
|
job, err = clientSet.BatchV1().Jobs(ns.Name).Get(ctx, job.Name, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to get Job after %s: %v", s, err)
|
t.Fatalf("Failed to get Job after %s: %v", s, err)
|
||||||
@ -615,7 +615,7 @@ func TestSuspendJobControllerRestart(t *testing.T) {
|
|||||||
}
|
}
|
||||||
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
|
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
|
||||||
Active: 0,
|
Active: 0,
|
||||||
}, false)
|
}, true)
|
||||||
|
|
||||||
// Disable feature gate and restart controller to test that pods get created.
|
// Disable feature gate and restart controller to test that pods get created.
|
||||||
defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.SuspendJob, false)()
|
defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.SuspendJob, false)()
|
||||||
@ -627,7 +627,7 @@ func TestSuspendJobControllerRestart(t *testing.T) {
|
|||||||
}
|
}
|
||||||
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
|
validateJobPodsStatus(ctx, t, clientSet, job, podsByStatus{
|
||||||
Active: 2,
|
Active: 2,
|
||||||
}, false)
|
}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNodeSelectorUpdate(t *testing.T) {
|
func TestNodeSelectorUpdate(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user