Skip to content

Commit 916d8c4

Browse files
committed
add github workflow to check supportedFeatures freshness
1 parent d604611 commit 916d8c4

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'kubebuilder-supported-features-freshness'
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- master
7+
paths:
8+
- 'conformance/utils/suite/**'
9+
jobs:
10+
checker:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 'checkout'
14+
uses: actions/checkout@v4
15+
- name: 'check_diff'
16+
run: |
17+
RED='\033[0;31m'
18+
GREEN='\033[0;32m'
19+
NC='\033[0m'
20+
current_features=$(grep -B 1 'type SupportedFeature string' apis/v1/gatewayclass_types.go | grep -oP '// \+kubebuilder:validation:Enum=\K.*')
21+
expected_features=$(go run hack/supportedfeatures/main.go)
22+
if [[ "$current_features" != "$expected_features" ]]; then
23+
echo "found diff between the current and the expected supportedFeatures"
24+
echo -e "expected: ${GREEN}${expected_features}${NC}"
25+
echo -e "current: ${RED}${current_features}${NC}"
26+
exit 1
27+
fi

conformance/utils/suite/features.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ var MeshCoreFeatures = sets.New(
217217

218218
// AllFeatures contains all the supported features and can be used to run all
219219
// conformance tests with `all-features` flag.
220-
//
220+
// asd
221221
// NOTE: as new feature sets are added they should be inserted into this set.
222222
var AllFeatures = sets.New[SupportedFeature]().
223223
Insert(GatewayExtendedFeatures.UnsortedList()...).

0 commit comments

Comments
 (0)