mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
fix arguments too long error
This commit is contained in:
parent
db107b190c
commit
c3f550f3cb
@ -74,12 +74,16 @@ func main() {
|
|||||||
if len(errors) != 0 {
|
if len(errors) != 0 {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
if len(stableMetrics) == 0 {
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
sort.Sort(byFQName(stableMetrics))
|
sort.Sort(byFQName(stableMetrics))
|
||||||
data, err := yaml.Marshal(stableMetrics)
|
data, err := yaml.Marshal(stableMetrics)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s\n", err)
|
fmt.Fprintf(os.Stderr, "%s\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Print(string(data))
|
fmt.Print(string(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ find_files_to_check() {
|
|||||||
-o -wholename '*/third_party/*' \
|
-o -wholename '*/third_party/*' \
|
||||||
-o -wholename '*/vendor/*' \
|
-o -wholename '*/vendor/*' \
|
||||||
-o -wholename '*/hack/*' \
|
-o -wholename '*/hack/*' \
|
||||||
-o -wholename '**/*_test.go' \
|
-o -wholename '*_test.go' \
|
||||||
\) -prune \
|
\) -prune \
|
||||||
\) \
|
\) \
|
||||||
\( -wholename '**/*.go' \
|
\( -wholename '**/*.go' \
|
||||||
@ -57,43 +57,32 @@ reset=$(tput sgr0)
|
|||||||
|
|
||||||
kube::validate::stablemetrics() {
|
kube::validate::stablemetrics() {
|
||||||
stability_check_setup
|
stability_check_setup
|
||||||
static_checked_files=$(find_files_to_check | grep -E ".*.go" | grep -v ".*_test.go") || true
|
|
||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
gopathfiles=$(find_files_to_check | grep -E 'test/instrumentation/.*.go' | grep -v "test/instrumentation/main.*go" | cut -c 3-)
|
doValidate=$(find_files_to_check | grep -E ".*.go" | grep -v ".*_test.go" | sort | 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}")
|
||||||
for i in "${static_checked_files[@]}"
|
|
||||||
do
|
if $doValidate; then
|
||||||
# Deliberately allow word split here
|
echo -e "${green}Diffing test/instrumentation/testdata/stable-metrics-list.yaml\n${reset}"
|
||||||
# shellcheck disable=SC2086
|
if diff -u "$KUBE_ROOT/test/instrumentation/testdata/stable-metrics-list.yaml" "$temp_file"; then
|
||||||
stabilitycheck=$(go run "test/instrumentation/main.go" $gopathfiles -- $i 1>$temp_file)
|
echo -e "${green}\nPASS metrics stability verification ${reset}"
|
||||||
if $stabilitycheck; then
|
return 0
|
||||||
echo -e "${green}Diffing test/instrumentation/testdata/stable-metrics-list.yaml\n${reset}"
|
|
||||||
if diff -u "$KUBE_ROOT/test/instrumentation/testdata/stable-metrics-list.yaml" "$temp_file"; then
|
|
||||||
echo -e "${green}\nPASS metrics stability verification ${reset}"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
echo "${red}!!! Metrics Stability static analysis has failed!${reset}" >&2
|
fi
|
||||||
echo "${red}!!! Please run ./hack/update-generated-stable-metrics.sh to update the golden list.${reset}" >&2
|
|
||||||
exit 1
|
echo "${red}!!! Metrics Stability static analysis has failed!${reset}" >&2
|
||||||
done
|
echo "${red}!!! Please run ./hack/update-generated-stable-metrics.sh to update the golden list.${reset}" >&2
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
kube::update::stablemetrics() {
|
kube::update::stablemetrics() {
|
||||||
stability_check_setup
|
stability_check_setup
|
||||||
static_checked_files=$(find_files_to_check | grep -E ".*.go" | grep -v ".*_test.go") || true
|
|
||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
gopathfiles=$(find_files_to_check | grep -E 'test/instrumentation/.*.go' | grep -v "test/instrumentation/main.*go" | cut -c 3-)
|
doCheckStability=$(find_files_to_check | grep -E ".*.go" | grep -v ".*_test.go" | sort | 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}")
|
||||||
for i in "${static_checked_files[@]}"
|
|
||||||
do
|
if ! $doCheckStability; then
|
||||||
# Deliberately allow word split here
|
echo "${red}!!! updating golden list of metrics has failed! ${reset}" >&2
|
||||||
# shellcheck disable=SC2086
|
exit 1
|
||||||
stabilitycheck=$(go run "test/instrumentation/main.go" $gopathfiles -- $i 1>$temp_file)
|
fi
|
||||||
if ! $stabilitycheck; then
|
mv -f "$temp_file" "${KUBE_ROOT}/test/instrumentation/testdata/stable-metrics-list.yaml"
|
||||||
echo "${red}!!! updating golden list of metrics has failed! ${reset}" >&2
|
echo "${green}Updated golden list of stable metrics.${reset}"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mv -f "$temp_file" "${KUBE_ROOT}/test/instrumentation/testdata/stable-metrics-list.yaml"
|
|
||||||
echo "${green}Updated golden list of stable metrics.${reset}"
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
[]
|
|
Loading…
Reference in New Issue
Block a user