Add Job.status.uncountedPodUIDs

For tracking Job Pods that have finished but are not yet counted as failed or succeeded

And feature gate JobTrackingWithFinalizers

Change-Id: I3e080f3ec090922640384b692e88eaf9a544d3b5

Kubernetes-commit: bb56a0bd04891ae0a4aebeaeb4d145b32d9ad2d9
This commit is contained in:
Aldo Culquicondor 2021-01-18 13:36:03 -05:00 committed by Kubernetes Publisher
parent 69e00b04ba
commit 3bb4101a36
4 changed files with 92 additions and 7 deletions

View File

@ -25,13 +25,14 @@ import (
// JobStatusApplyConfiguration represents an declarative configuration of the JobStatus type for use
// with apply.
type JobStatusApplyConfiguration struct {
Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"`
StartTime *metav1.Time `json:"startTime,omitempty"`
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
Active *int32 `json:"active,omitempty"`
Succeeded *int32 `json:"succeeded,omitempty"`
Failed *int32 `json:"failed,omitempty"`
CompletedIndexes *string `json:"completedIndexes,omitempty"`
Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"`
StartTime *metav1.Time `json:"startTime,omitempty"`
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
Active *int32 `json:"active,omitempty"`
Succeeded *int32 `json:"succeeded,omitempty"`
Failed *int32 `json:"failed,omitempty"`
CompletedIndexes *string `json:"completedIndexes,omitempty"`
UncountedTerminatedPods *UncountedTerminatedPodsApplyConfiguration `json:"uncountedTerminatedPods,omitempty"`
}
// JobStatusApplyConfiguration constructs an declarative configuration of the JobStatus type for use with
@ -100,3 +101,11 @@ func (b *JobStatusApplyConfiguration) WithCompletedIndexes(value string) *JobSta
b.CompletedIndexes = &value
return b
}
// WithUncountedTerminatedPods sets the UncountedTerminatedPods field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UncountedTerminatedPods field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithUncountedTerminatedPods(value *UncountedTerminatedPodsApplyConfiguration) *JobStatusApplyConfiguration {
b.UncountedTerminatedPods = value
return b
}

View File

@ -0,0 +1,56 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
import (
types "k8s.io/apimachinery/pkg/types"
)
// UncountedTerminatedPodsApplyConfiguration represents an declarative configuration of the UncountedTerminatedPods type for use
// with apply.
type UncountedTerminatedPodsApplyConfiguration struct {
Succeeded []types.UID `json:"succeeded,omitempty"`
Failed []types.UID `json:"failed,omitempty"`
}
// UncountedTerminatedPodsApplyConfiguration constructs an declarative configuration of the UncountedTerminatedPods type for use with
// apply.
func UncountedTerminatedPods() *UncountedTerminatedPodsApplyConfiguration {
return &UncountedTerminatedPodsApplyConfiguration{}
}
// WithSucceeded adds the given value to the Succeeded field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Succeeded field.
func (b *UncountedTerminatedPodsApplyConfiguration) WithSucceeded(values ...types.UID) *UncountedTerminatedPodsApplyConfiguration {
for i := range values {
b.Succeeded = append(b.Succeeded, values[i])
}
return b
}
// WithFailed adds the given value to the Failed field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Failed field.
func (b *UncountedTerminatedPodsApplyConfiguration) WithFailed(values ...types.UID) *UncountedTerminatedPodsApplyConfiguration {
for i := range values {
b.Failed = append(b.Failed, values[i])
}
return b
}

View File

@ -2710,6 +2710,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: succeeded
type:
scalar: numeric
- name: uncountedTerminatedPods
type:
namedType: io.k8s.api.batch.v1.UncountedTerminatedPods
- name: io.k8s.api.batch.v1.JobTemplateSpec
map:
fields:
@ -2721,6 +2724,21 @@ var schemaYAML = typed.YAMLObject(`types:
type:
namedType: io.k8s.api.batch.v1.JobSpec
default: {}
- name: io.k8s.api.batch.v1.UncountedTerminatedPods
map:
fields:
- name: failed
type:
list:
elementType:
scalar: string
elementRelationship: associative
- name: succeeded
type:
list:
elementType:
scalar: string
elementRelationship: associative
- name: io.k8s.api.batch.v1beta1.CronJob
map:
fields:

View File

@ -395,6 +395,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationsbatchv1.JobStatusApplyConfiguration{}
case batchv1.SchemeGroupVersion.WithKind("JobTemplateSpec"):
return &applyconfigurationsbatchv1.JobTemplateSpecApplyConfiguration{}
case batchv1.SchemeGroupVersion.WithKind("UncountedTerminatedPods"):
return &applyconfigurationsbatchv1.UncountedTerminatedPodsApplyConfiguration{}
// Group=batch, Version=v1beta1
case batchv1beta1.SchemeGroupVersion.WithKind("CronJob"):