generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github workflow to check supportedFeatures freshness
- Loading branch information
1 parent
d604611
commit 7d365b9
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: 'kubebuilder-supported-features-freshness' | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
paths: | ||
- 'conformance/utils/suite/**' | ||
jobs: | ||
checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'checkout' | ||
uses: actions/checkout@v4 | ||
- name: 'check_diff' | ||
run: | | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
NC='\033[0m | ||
current_features=$(grep -B 1 'type SupportedFeature string' apis/v1/gatewayclass_types.go | grep -oP '// \+kubebuilder:validation:Enum=\K.*') | ||
expected_features=$(go run hack/supportedfeatures/main.go) | ||
if [[ "$current_features" != "$expected_features" ]]; then | ||
echo "found diff between the current and the expected supportedFeatures" | ||
echo -e "expected: ${GREEN}${expected_features}${NC}" | ||
echo "current: ${RED}${current_features}${NC}" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters