Skip to content

Commit a4342aa

Browse files
authored
fix codegen by using newer scripts (#1042)
1 parent 5afdd71 commit a4342aa

File tree

15 files changed

+155
-722
lines changed

15 files changed

+155
-722
lines changed

hack/update-codegen.sh

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ set -o pipefail
2020

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

23-
# If we run with -mod=vendor here, then generate-groups.sh looks for vendor files in the wrong place.
24-
export GOFLAGS=-mod=
25-
2623
echo "=== Update Codegen for $MODULE_NAME"
2724

2825
group "Generating checksums for configmap _example keys"
2926

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

3229
group "Kubernetes Codegen"
30+
source "${CODEGEN_PKG}/kube_codegen.sh"
3331

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

4343
group "Knative Codegen"
4444

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

51-
group "Deepcopy Gen"
52-
53-
# Depends on generate-groups.sh to install bin/deepcopy-gen
54-
${GOPATH}/bin/deepcopy-gen \
55-
-O zz_generated.deepcopy \
56-
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \
57-
-i knative.dev/networking/pkg/apis/config \
58-
-i knative.dev/networking/pkg/config
59-
6051
group "Update deps post-codegen"
6152

6253
# Make sure our dependencies are up-to-date

pkg/client/clientset/versioned/fake/clientset_generated.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/clientset/versioned/typed/networking/v1alpha1/certificate.go

Lines changed: 10 additions & 136 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/clientset/versioned/typed/networking/v1alpha1/clusterdomainclaim.go

Lines changed: 9 additions & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)