Skip to content

Commit bc893fc

Browse files
authored
Merge pull request kubernetes#128134 from siyuanfoundation/script
add instructions into verify-featuregates script.
2 parents e8b59af + a2bf91e commit bc893fc

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

hack/verify-featuregates.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
2828

2929
cd "${KUBE_ROOT}"
3030

31-
go run test/featuregates_linter/main.go feature-gates verify
31+
if ! go run test/featuregates_linter/main.go feature-gates verify; then
32+
echo "Please run 'hack/update-featuregates.sh' to update the feature list."
33+
exit 1
34+
fi

test/featuregates_linter/cmd/feature_gates.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,23 @@ func NewUpdateFeatureListCommand() *cobra.Command {
9696

9797
func verifyFeatureListFunc(cmd *cobra.Command, args []string) {
9898
if err := verifyOrUpdateFeatureList(k8RootPath, unversionedFeatureListFile, false, false); err != nil {
99-
panic(err)
99+
fmt.Fprintf(os.Stderr, "Failed to verify feature list: \n%s", err)
100+
os.Exit(1)
100101
}
101102
if err := verifyOrUpdateFeatureList(k8RootPath, versionedFeatureListFile, false, true); err != nil {
102-
panic(err)
103+
fmt.Fprintf(os.Stderr, "Failed to verify versioned feature list: \n%s", err)
104+
os.Exit(1)
103105
}
104106
}
105107

106108
func updateFeatureListFunc(cmd *cobra.Command, args []string) {
107109
if err := verifyOrUpdateFeatureList(k8RootPath, unversionedFeatureListFile, true, false); err != nil {
108-
panic(err)
110+
fmt.Fprintf(os.Stderr, "Failed to update feature list: \n%s", err)
111+
os.Exit(1)
109112
}
110113
if err := verifyOrUpdateFeatureList(k8RootPath, versionedFeatureListFile, true, true); err != nil {
111-
panic(err)
114+
fmt.Fprintf(os.Stderr, "Failed to update versioned feature list: \n%s", err)
115+
os.Exit(1)
112116
}
113117
}
114118

0 commit comments

Comments
 (0)