diff --git a/hack/update-bazel.sh b/hack/update-bazel.sh index 9e7eb55b48e..c45ab3b6f0a 100755 --- a/hack/update-bazel.sh +++ b/hack/update-bazel.sh @@ -19,12 +19,17 @@ set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -# delete all bazel related files -find "${KUBE_ROOT}" \( \ - -name BUILD \ - -o -name BUILD.bazel \ - -o -name '*.bzl' \ -\) \ +# delete all bazel related files not in vendor/ +find "${KUBE_ROOT}" \ + \( \ + -name BUILD \ + -o -name BUILD.bazel \ + -o -name '*.bzl' \ + \) \ + -not \ + \( \ + -path "${KUBE_ROOT}"'/vendor*' \ + \) \ -delete # remove additional one-off bazel related files diff --git a/hack/update-vendor.sh b/hack/update-vendor.sh index e881587395a..bc7796c2ebe 100755 --- a/hack/update-vendor.sh +++ b/hack/update-vendor.sh @@ -378,15 +378,6 @@ for repo in $(kube::util::list_staging_repos); do ln -s "../../staging/src/k8s.io/${repo}" "${KUBE_ROOT}/vendor/k8s.io/${repo}" done -kube::log::status "vendor: updating BUILD files" -# Assume that anything imported through vendor doesn't need Bazel to build. -# Prune out any Bazel build files, since these can break the build due to -# missing dependencies that aren't included by go mod vendor. -find vendor/ -type f \ - \( -name BUILD -o -name BUILD.bazel -o -name WORKSPACE \) \ - -exec rm -f {} \; -hack/update-bazel.sh >>"${LOG_FILE}" 2>&1 - kube::log::status "vendor: updating vendor/LICENSES" hack/update-vendor-licenses.sh >>"${LOG_FILE}" 2>&1