Skip to content

Commit

Permalink
fix codegen by using newer scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dprotaso committed Jan 27, 2025
1 parent 6797968 commit b207435
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 722 deletions.
33 changes: 12 additions & 21 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ set -o pipefail

source $(dirname $0)/../vendor/knative.dev/hack/codegen-library.sh

# If we run with -mod=vendor here, then generate-groups.sh looks for vendor files in the wrong place.
export GOFLAGS=-mod=

echo "=== Update Codegen for $MODULE_NAME"

group "Generating checksums for configmap _example keys"

go run "${REPO_ROOT_DIR}/vendor/knative.dev/pkg/configmap/hash-gen" "${REPO_ROOT_DIR}"/config/config-network.yaml
go run knative.dev/pkg/configmap/hash-gen "${REPO_ROOT_DIR}/config/config-network.yaml"

group "Kubernetes Codegen"
source "${CODEGEN_PKG}/kube_codegen.sh"

# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
knative.dev/networking/pkg/client knative.dev/networking/pkg/apis \
"networking:v1alpha1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
kube::codegen::gen_helpers \
--boilerplate "${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt" \
"${REPO_ROOT_DIR}/pkg/apis"

kube::codegen::gen_client \
--boilerplate "${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt" \
--output-dir "${REPO_ROOT_DIR}/pkg/client" \
--output-pkg "knative.dev/networking/pkg/client" \
--with-watch \
"${REPO_ROOT_DIR}/pkg/apis"

group "Knative Codegen"

Expand All @@ -48,15 +48,6 @@ ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \
"networking:v1alpha1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt

group "Deepcopy Gen"

# Depends on generate-groups.sh to install bin/deepcopy-gen
${GOPATH}/bin/deepcopy-gen \
-O zz_generated.deepcopy \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \
-i knative.dev/networking/pkg/apis/config \
-i knative.dev/networking/pkg/config

group "Update deps post-codegen"

# Make sure our dependencies are up-to-date
Expand Down
6 changes: 5 additions & 1 deletion pkg/client/clientset/versioned/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

146 changes: 10 additions & 136 deletions pkg/client/clientset/versioned/typed/networking/v1alpha1/certificate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b207435

Please sign in to comment.