Merge pull request #98817 from alculquicondor/job-completion-api

Add Job.status.uncountedTerminatedPods for Job tracking

Kubernetes-commit: b76549665070beb2cc1a0410a6c7f66d8007f76b
This commit is contained in:
Kubernetes Publisher 2021-07-08 10:44:54 -07:00
commit f0bc45ffb4
6 changed files with 100 additions and 15 deletions

View File

@ -25,13 +25,14 @@ import (
// JobStatusApplyConfiguration represents an declarative configuration of the JobStatus type for use // JobStatusApplyConfiguration represents an declarative configuration of the JobStatus type for use
// with apply. // with apply.
type JobStatusApplyConfiguration struct { type JobStatusApplyConfiguration struct {
Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"` Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"`
StartTime *metav1.Time `json:"startTime,omitempty"` StartTime *metav1.Time `json:"startTime,omitempty"`
CompletionTime *metav1.Time `json:"completionTime,omitempty"` CompletionTime *metav1.Time `json:"completionTime,omitempty"`
Active *int32 `json:"active,omitempty"` Active *int32 `json:"active,omitempty"`
Succeeded *int32 `json:"succeeded,omitempty"` Succeeded *int32 `json:"succeeded,omitempty"`
Failed *int32 `json:"failed,omitempty"` Failed *int32 `json:"failed,omitempty"`
CompletedIndexes *string `json:"completedIndexes,omitempty"` CompletedIndexes *string `json:"completedIndexes,omitempty"`
UncountedTerminatedPods *UncountedTerminatedPodsApplyConfiguration `json:"uncountedTerminatedPods,omitempty"`
} }
// JobStatusApplyConfiguration constructs an declarative configuration of the JobStatus type for use with // 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 b.CompletedIndexes = &value
return b 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 - name: succeeded
type: type:
scalar: numeric scalar: numeric
- name: uncountedTerminatedPods
type:
namedType: io.k8s.api.batch.v1.UncountedTerminatedPods
- name: io.k8s.api.batch.v1.JobTemplateSpec - name: io.k8s.api.batch.v1.JobTemplateSpec
map: map:
fields: fields:
@ -2721,6 +2724,21 @@ var schemaYAML = typed.YAMLObject(`types:
type: type:
namedType: io.k8s.api.batch.v1.JobSpec namedType: io.k8s.api.batch.v1.JobSpec
default: {} 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 - name: io.k8s.api.batch.v1beta1.CronJob
map: map:
fields: fields:

View File

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

8
go.mod
View File

@ -30,8 +30,8 @@ require (
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
google.golang.org/protobuf v1.26.0 google.golang.org/protobuf v1.26.0
k8s.io/api v0.0.0-20210708014407-1e1dad4bd9d1 k8s.io/api v0.0.0-20210708214500-0ff29d3f16e4
k8s.io/apimachinery v0.0.0-20210708014216-0dafcb48b31e k8s.io/apimachinery v0.0.0-20210708214246-ff522ab81c74
k8s.io/klog/v2 v2.9.0 k8s.io/klog/v2 v2.9.0
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 sigs.k8s.io/structured-merge-diff/v4 v4.1.2
@ -39,6 +39,6 @@ require (
) )
replace ( replace (
k8s.io/api => k8s.io/api v0.0.0-20210708014407-1e1dad4bd9d1 k8s.io/api => k8s.io/api v0.0.0-20210708214500-0ff29d3f16e4
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210708014216-0dafcb48b31e k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210708214246-ff522ab81c74
) )

8
go.sum
View File

@ -444,10 +444,10 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20210708014407-1e1dad4bd9d1 h1:BsVbhrF9ZXWlpo/84y3WdGGw+SYu61RlNKOMqGKDIQE= k8s.io/api v0.0.0-20210708214500-0ff29d3f16e4 h1:SONTS5tRMTV7iWmw9T6C7vsEFrQy4bygwu/PaUJP2Lo=
k8s.io/api v0.0.0-20210708014407-1e1dad4bd9d1/go.mod h1:UGtjmHCgj1IMXqa0rRAXNNszZBo1IKpAhbvSre33vSU= k8s.io/api v0.0.0-20210708214500-0ff29d3f16e4/go.mod h1:72i8FbvEsYM9+Hy9ZRCr4WADf5G8kTsusBNrcSkt2aY=
k8s.io/apimachinery v0.0.0-20210708014216-0dafcb48b31e h1:EZ+ZrcPtnkR8vVo7bBSwoMD9a0HaC29O6lJhcZgwsJQ= k8s.io/apimachinery v0.0.0-20210708214246-ff522ab81c74 h1:Daxg4VCqUpkKuMJjia7XcVVDHnPjH6IeKb7jcZDcQUM=
k8s.io/apimachinery v0.0.0-20210708014216-0dafcb48b31e/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.0.0-20210708214246-ff522ab81c74/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM=