From 2fefd27bfd85c0635efc14043f85915e5d7b263c Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 28 Feb 2025 16:25:01 -0500 Subject: [PATCH] Update zz_generated.deepcopy.go, also add new make target for the same Signed-off-by: Davanum Srinivas --- Makefile | 4 ++ build/scripts/update-codegen.sh | 29 +++---------- .../v1alpha5/zz_generated.deepcopy.go | 41 +++++++++++++++++++ 3 files changed, 50 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index a604c4aa91..d65983031f 100644 --- a/Makefile +++ b/Makefile @@ -189,6 +189,10 @@ update-coredns: ## get latest coredns builds for each available eks version update-ec2-info: ## get latest info on ec2 instance types @go run cmd/ec2geninfo/main.go +.PHONY: update-deepcopy +update-deepcopy: + build/scripts/update-codegen.sh + deep_copy_helper_input = $(shell $(call godeps_cmd,./pkg/apis/...) | sed 's|$(generated_code_deep_copy_helper)||' ) $(generated_code_deep_copy_helper): $(deep_copy_helper_input) ## Generate Kubernetes API helpers build/scripts/update-codegen.sh diff --git a/build/scripts/update-codegen.sh b/build/scripts/update-codegen.sh index 895a242b92..d1614326f0 100755 --- a/build/scripts/update-codegen.sh +++ b/build/scripts/update-codegen.sh @@ -4,34 +4,15 @@ set -o errexit set -o nounset -SCRIPT_ROOT=$(git rev-parse --show-toplevel) +PROJECT_ROOT=$(git rev-parse --show-toplevel) # Grab code-generator pkg CODEGEN_PKG=$(go list -m -f '{{.Dir}}' 'k8s.io/code-generator') echo ">> Using ${CODEGEN_PKG}" -# code-generator does work with go.mod but makes assumptions about -# the project living in `$GOPATH/src`. To work around this and support -# any location; create a temporary directory, use this as an output -# base, and copy everything back once generated. -TEMP_DIR=$(mktemp -d) -cleanup() { - echo ">> Removing ${TEMP_DIR}" - rm -rf "${TEMP_DIR}" -} -trap "cleanup" EXIT SIGINT -echo ">> Temporary output directory ${TEMP_DIR}" +source "${CODEGEN_PKG}/kube_codegen.sh" -# Ensure we can execute. -chmod +x "${CODEGEN_PKG}/generate-groups.sh" -chmod +x "${CODEGEN_PKG}/generate-internal-groups.sh" - -GOPATH=$(go env GOPATH) "${CODEGEN_PKG}/generate-groups.sh" deepcopy,defaulter \ - _ github.com/weaveworks/eksctl/pkg/apis \ - eksctl.io:v1alpha5 \ - --go-header-file <(printf "/*\n%s\n*/\n" "$(cat LICENSE)") \ - --output-base "${TEMP_DIR}" - -# Copy everything back. -cp -r "${TEMP_DIR}/github.com/weaveworks/eksctl/." "${SCRIPT_ROOT}/" +kube::codegen::gen_helpers \ + --boilerplate <(printf "/*\n%s\n*/\n" "$(cat LICENSE)") \ + "${PROJECT_ROOT}/pkg/apis" diff --git a/pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go b/pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go index 5b6287bf1d..a7f4cf7a23 100644 --- a/pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go +++ b/pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go @@ -1268,6 +1268,27 @@ func (in InlineDocument) DeepCopyInto(out *InlineDocument) { } } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceMarketOptions) DeepCopyInto(out *InstanceMarketOptions) { + *out = *in + if in.MarketType != nil { + in, out := &in.MarketType, &out.MarketType + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceMarketOptions. +func (in *InstanceMarketOptions) DeepCopy() *InstanceMarketOptions { + if in == nil { + return nil + } + out := new(InstanceMarketOptions) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstanceSelector) DeepCopyInto(out *InstanceSelector) { *out = *in @@ -1276,6 +1297,21 @@ func (in *InstanceSelector) DeepCopyInto(out *InstanceSelector) { *out = new(int) **out = **in } + if in.NeuronDevices != nil { + in, out := &in.NeuronDevices, &out.NeuronDevices + *out = new(int32) + **out = **in + } + if in.Allow != nil { + in, out := &in.Allow, &out.Allow + *out = new(string) + **out = **in + } + if in.Deny != nil { + in, out := &in.Deny, &out.Deny + *out = new(string) + **out = **in + } return } @@ -1679,6 +1715,11 @@ func (in *NodeGroupBase) DeepCopyInto(out *NodeGroupBase) { *out = new(CapacityReservation) (*in).DeepCopyInto(*out) } + if in.InstanceMarketOptions != nil { + in, out := &in.InstanceMarketOptions, &out.InstanceMarketOptions + *out = new(InstanceMarketOptions) + (*in).DeepCopyInto(*out) + } return }