Fix for verify: generated-stable-metrics problem

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2022-03-22 21:33:52 -04:00
parent 1ce55e3afe
commit 3470453e01
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59

View File

@ -29,6 +29,8 @@ stability_check_setup() {
export KUBE_EXTRA_GOPATH=$KUBE_TEMP
kube::golang::setup_env
pushd "${KUBE_EXTRA_GOPATH}" >/dev/null
touch go.mod
GO111MODULE=on go mod edit -module=example.com/mod
GO111MODULE=on go get "gopkg.in/yaml.v2"
popd >/dev/null
}
@ -58,7 +60,7 @@ reset=$(tput sgr0)
kube::validate::stablemetrics() {
stability_check_setup
temp_file=$(mktemp)
doValidate=$(find_files_to_check | grep -E ".*.go" | grep -v ".*_test.go" | sort | KUBE_ROOT=${KUBE_ROOT} xargs -L 200 go run "test/instrumentation/main.go" "test/instrumentation/decode_metric.go" "test/instrumentation/find_stable_metric.go" "test/instrumentation/error.go" "test/instrumentation/metric.go" -- 1>"${temp_file}")
doValidate=$(find_files_to_check | grep -E ".*.go" | grep -v ".*_test.go" | grep -v ".git" | sort | KUBE_ROOT=${KUBE_ROOT} xargs -L 200 go run "test/instrumentation/main.go" "test/instrumentation/decode_metric.go" "test/instrumentation/find_stable_metric.go" "test/instrumentation/error.go" "test/instrumentation/metric.go" -- 1>"${temp_file}")
if $doValidate; then
echo -e "${green}Diffing test/instrumentation/testdata/stable-metrics-list.yaml\n${reset}"