Refactor codegen to use kube_codegen.sh script (#1964)

This commit is contained in:
David Simansky 2024-09-03 16:51:32 +02:00 committed by GitHub
parent f09e7164ce
commit 9728a1e0fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 5 deletions

15
hack/boilerplate.go.txt Normal file
View File

@ -0,0 +1,15 @@
/*
Copyright 2024 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

View File

@ -25,9 +25,11 @@ echo "=== Update Codegen for $MODULE_NAME"
group "Kubernetes Codegen"
generate-groups "deepcopy" \
knative.dev/client/pkg/apis/client/v1alpha1/generated knative.dev/client/pkg/apis \
client:v1alpha1 "$@"
source "${CODEGEN_PKG}/kube_codegen.sh"
kube::codegen::gen_helpers \
--boilerplate "${REPO_ROOT_DIR}/hack/boilerplate.go.txt" \
"${REPO_ROOT_DIR}/pkg/apis"
group "Update deps post-codegen"

View File

@ -2,13 +2,13 @@
// +build !ignore_autogenerated
/*
Copyright 2020 The Knative Authors
Copyright 2024 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,