add test for the registered feature gates

This commit is contained in:
Nikola
2023-10-31 20:44:56 +02:00
committed by Nikola
parent 60dcf7fd8d
commit 5704a58810
3 changed files with 75 additions and 4 deletions

View File

@@ -53,4 +53,19 @@ if [[ -n "${missing_defers}" ]]; then
rc=1
fi
# ensure all generic features are added in alphabetic order
lines=$(git grep 'genericfeatures[.].*:' -- pkg/features/kube_features.go)
sorted_lines=$(echo "$lines" | sort -f)
if [[ "$lines" != "$sorted_lines" ]]; then
echo "Generic features in pkg/features/kube_features.go not sorted" >&2
echo >&2
echo "Expected:" >&2
echo "$sorted_lines" >&2
echo >&2
echo "Got:" >&2
echo "$lines" >&2
rc=1
fi
exit $rc