add instructions into verify-featuregates script.

Signed-off-by: Siyuan Zhang <sizhang@google.com>
This commit is contained in:
Siyuan Zhang 2024-10-16 11:14:22 -07:00
parent b0d0a1557d
commit a2bf91e9cf
2 changed files with 12 additions and 5 deletions

View File

@ -28,4 +28,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
cd "${KUBE_ROOT}"
go run test/featuregates_linter/main.go feature-gates verify
if ! go run test/featuregates_linter/main.go feature-gates verify; then
echo "Please run 'hack/update-featuregates.sh' to update the feature list."
exit 1
fi

View File

@ -96,19 +96,23 @@ func NewUpdateFeatureListCommand() *cobra.Command {
func verifyFeatureListFunc(cmd *cobra.Command, args []string) {
if err := verifyOrUpdateFeatureList(k8RootPath, unversionedFeatureListFile, false, false); err != nil {
panic(err)
fmt.Fprintf(os.Stderr, "Failed to verify feature list: \n%s", err)
os.Exit(1)
}
if err := verifyOrUpdateFeatureList(k8RootPath, versionedFeatureListFile, false, true); err != nil {
panic(err)
fmt.Fprintf(os.Stderr, "Failed to verify versioned feature list: \n%s", err)
os.Exit(1)
}
}
func updateFeatureListFunc(cmd *cobra.Command, args []string) {
if err := verifyOrUpdateFeatureList(k8RootPath, unversionedFeatureListFile, true, false); err != nil {
panic(err)
fmt.Fprintf(os.Stderr, "Failed to update feature list: \n%s", err)
os.Exit(1)
}
if err := verifyOrUpdateFeatureList(k8RootPath, versionedFeatureListFile, true, true); err != nil {
panic(err)
fmt.Fprintf(os.Stderr, "Failed to update versioned feature list: \n%s", err)
os.Exit(1)
}
}