Skip to content

Commit

Permalink
fix generation of our clientset (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
dprotaso authored Jan 17, 2025
1 parent dee364d commit 817ae30
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 199 deletions.
24 changes: 12 additions & 12 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ 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 "Kubernetes Codegen"

# 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/caching/pkg/client knative.dev/caching/pkg/apis \
"caching:v1alpha1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
source "${CODEGEN_PKG}/kube_codegen.sh"

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

kube::codegen::gen_helpers \
--boilerplate "${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt" \
"${REPO_ROOT_DIR}/pkg"

group "Knative Codegen"

Expand Down
2 changes: 1 addition & 1 deletion hack/update-schemas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -o pipefail

REPO_ROOT="$(git rev-parse --show-toplevel)"

go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.0 \
go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.1 \
schemapatch:manifests=config/,generateEmbeddedObjectMeta=false \
output:dir=config \
paths=./pkg/apis/...
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.

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/caching/v1alpha1/image.go

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

1 change: 1 addition & 0 deletions pkg/client/informers/externalversions/factory.go

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

Loading

0 comments on commit 817ae30

Please sign in to comment.