mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Merge pull request #139013 from yongruilin/dv-update-codegen-fix
hack: glob-remove all validation-gen outputs in update-codegen.sh
This commit is contained in:
commit
042ae1c307
87 changed files with 7 additions and 4 deletions
|
|
@ -420,8 +420,11 @@ function codegen::validation() {
|
|||
k8s.io/code-generator/cmd/validation-gen
|
||||
|
||||
# TODO: Where do we want these output? It should be somewhere internal..
|
||||
# The result file, in each pkg, of validation generation.
|
||||
local output_file="${GENERATED_FILE_PREFIX}validations.go"
|
||||
# All files emitted by validation-gen (the per-pkg validations file and the
|
||||
# per-Kind coverage test fixtures under test/declarative_validation/) share
|
||||
# this prefix so the cleanup below can glob-remove them in one pass.
|
||||
local output_file_prefix="${GENERATED_FILE_PREFIX}validations."
|
||||
local output_file="${output_file_prefix}go"
|
||||
|
||||
# All directories that request any form of validation generation.
|
||||
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
||||
|
|
@ -462,14 +465,14 @@ function codegen::validation() {
|
|||
done
|
||||
fi
|
||||
|
||||
git_find -z ':(glob)**'/"${output_file}" | xargs -0 rm -f
|
||||
git_find -z ':(glob)**'/"${output_file_prefix}"'*' | xargs -0 rm -f
|
||||
|
||||
validation-gen \
|
||||
-v "${KUBE_VERBOSE}" \
|
||||
--go-header-file "${BOILERPLATE_FILENAME}" \
|
||||
--output-file "${output_file}" \
|
||||
--test-output-root "test/declarative_validation" \
|
||||
--test-output-file-prefix "${GENERATED_FILE_PREFIX}" \
|
||||
--test-output-file-prefix "${output_file_prefix}" \
|
||||
--test-allowlist "test/declarative_validation/coverage-allowlist.yaml" \
|
||||
--lint-rules=known-tags-only,require-explicit-disablement \
|
||||
$(printf -- " --readonly-pkg %s" "${readonly_pkgs[@]}") \
|
||||
|
|
|
|||
Loading…
Reference in a new issue