From 23d7d0dc801d0354071b8d68c99b72b5a981afee Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Mon, 10 Feb 2025 08:49:04 +0100 Subject: [PATCH] Add missing external types to apply configurations --- .../jobset/v1alpha2/replicatedjob.go | 14 +++++++------- hack/update-codegen.sh | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client-go/applyconfiguration/jobset/v1alpha2/replicatedjob.go b/client-go/applyconfiguration/jobset/v1alpha2/replicatedjob.go index 64deb885c..3e79f3a71 100644 --- a/client-go/applyconfiguration/jobset/v1alpha2/replicatedjob.go +++ b/client-go/applyconfiguration/jobset/v1alpha2/replicatedjob.go @@ -15,16 +15,16 @@ limitations under the License. package v1alpha2 import ( - v1 "k8s.io/api/batch/v1" + v1 "k8s.io/client-go/applyconfigurations/batch/v1" ) // ReplicatedJobApplyConfiguration represents a declarative configuration of the ReplicatedJob type for use // with apply. type ReplicatedJobApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Template *v1.JobTemplateSpec `json:"template,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - DependsOn []DependsOnApplyConfiguration `json:"dependsOn,omitempty"` + Name *string `json:"name,omitempty"` + Template *v1.JobTemplateSpecApplyConfiguration `json:"template,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + DependsOn []DependsOnApplyConfiguration `json:"dependsOn,omitempty"` } // ReplicatedJobApplyConfiguration constructs a declarative configuration of the ReplicatedJob type for use with @@ -44,8 +44,8 @@ func (b *ReplicatedJobApplyConfiguration) WithName(value string) *ReplicatedJobA // WithTemplate sets the Template 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 Template field is set to the value of the last call. -func (b *ReplicatedJobApplyConfiguration) WithTemplate(value v1.JobTemplateSpec) *ReplicatedJobApplyConfiguration { - b.Template = &value +func (b *ReplicatedJobApplyConfiguration) WithTemplate(value *v1.JobTemplateSpecApplyConfiguration) *ReplicatedJobApplyConfiguration { + b.Template = value return b } diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index eb6dc1e7b..6071ad3b1 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -41,6 +41,7 @@ kube::codegen::gen_helpers \ kube::codegen::gen_client \ --with-watch \ --with-applyconfig \ + --applyconfig-externals "k8s.io/api/batch/v1.JobTemplateSpec:k8s.io/client-go/applyconfigurations/batch/v1" \ --output-dir "${REPO_ROOT}/client-go" \ --output-pkg sigs.k8s.io/jobset/client-go \ --boilerplate "${REPO_ROOT}/hack/boilerplate.go.txt" \