Skip to content

Commit 1bda3ef

Browse files
authored
Merge pull request kubernetes#127754 from skitt/followup-module-verify
hack verify.sh: clean up "base"
2 parents 426aa3d + be0cd19 commit 1bda3ef

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

hack/make-rules/verify.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function run-checks {
199199
else
200200
echo -e "${color_red}FAILED${color_norm} ${check_name}\t${elapsed}s"
201201
ret=1
202-
FAILED_TESTS+=("${base}/${t}")
202+
FAILED_TESTS+=("${PWD}/${t}")
203203
fi
204204
done
205205
}
@@ -229,15 +229,18 @@ if ${QUICK} ; then
229229
echo "Running in quick mode (QUICK=true). Only fast checks will run."
230230
fi
231231

232+
shopt -s globstar
232233
export API_KNOWN_VIOLATIONS_DIR="${KUBE_ROOT}"/api/api-rules
233234
ret=0
234-
modules=() # Pacify shellcheck
235-
kube::util::read-array modules < <(go list -f '{{.Dir}}' -m)
236-
for module in "${modules[@]}"; do
237-
base=${module%/go.mod}
238-
if [ -d "$base/hack" ]; then
239-
kube::util::run-in "$base" run-checks "hack/verify-*.sh" bash
240-
kube::util::run-in "$base" run-checks "hack/verify-*.py" python3
235+
# Modules are discovered by looking for go.mod rather than asking go
236+
# to ensure that modules that aren't part of the workspace and/or are
237+
# not dependencies are checked too.
238+
# . and staging are listed explicitly here to avoid _output
239+
for module in ./go.mod ./staging/**/go.mod; do
240+
module="${module%/go.mod}"
241+
if [ -d "$module/hack" ]; then
242+
kube::util::run-in "$module" run-checks "hack/verify-*.sh" bash
243+
kube::util::run-in "$module" run-checks "hack/verify-*.py" python3
241244
fi
242245
done
243246
missing-target-checks

0 commit comments

Comments
 (0)