Skip to content

Commit

Permalink
update code generator to k8s 1.31
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBatschner committed Nov 4, 2024
1 parent a8a5757 commit 681abe6
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,22 @@ set -o errexit
set -o nounset
set -o pipefail

PROJECT_ROOT="$(dirname "$0")"/..

# setup virtual GOPATH
# shellcheck disable=SC1091
source "$GARDENER_HACK_DIR"/vgopath-setup.sh

CODE_GEN_DIR=$(go list -m -f '{{.Dir}}' k8s.io/code-generator)
# shellcheck disable=SC1091
source "${CODE_GEN_DIR}/kube_codegen.sh"

# We need to explicitly pass GO111MODULE=off to k8s.io/code-generator as it is significantly slower otherwise,
# see https://github.com/kubernetes/code-generator/issues/100.
export GO111MODULE=off

rm -f $GOPATH/bin/*-gen

bash "${CODE_GEN_DIR}/generate-internal-groups.sh" \
deepcopy,defaulter \
github.com/gardener/gardener-extension-os-suse-chost/pkg/client \
github.com/gardener/gardener-extension-os-suse-chost/pkg/apis \
github.com/gardener/gardener-extension-os-suse-chost/pkg/apis \
"memoryonechost:v1alpha1" \
--go-header-file "${GARDENER_HACK_DIR}/LICENSE_BOILERPLATE.txt"
rm -f "$GOPATH/bin/*-gen"

bash "${CODE_GEN_DIR}/generate-internal-groups.sh" \
conversion \
github.com/gardener/gardener-extension-os-suse-chost/pkg/client \
github.com/gardener/gardener-extension-os-suse-chost/pkg/apis \
github.com/gardener/gardener-extension-os-suse-chost/pkg/apis \
"memoryonechost:v1alpha1" \
--extra-peer-dirs=github.com/gardener/gardener-extension-os-suse-chost/pkg/apis/memoryonechost,github.com/gardener/gardener-extension-os-suse-chost/pkg/apis/memoryonechost/v1alpha1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \
--go-header-file "${GARDENER_HACK_DIR}/LICENSE_BOILERPLATE.txt"
kube::codegen::gen_helpers \
--boilerplate "${GARDENER_HACK_DIR}/LICENSE_BOILERPLATE.txt" \
--extra-peer-dir k8s.io/apimachinery/pkg/apis/meta/v1 \
--extra-peer-dir k8s.io/apimachinery/pkg/conversion \
--extra-peer-dir k8s.io/component-base/config \
--extra-peer-dir k8s.io/component-base/config/v1alpha1 \
"${PROJECT_ROOT}/pkg/apis"

0 comments on commit 681abe6

Please sign in to comment.