Skip to content

Commit ec2013b

Browse files
authored
Merge pull request vmware-tanzu#8375 from kaovilai/run-e2e-latestk8s
Add v1.31, v1.30 to GHA matrix and use latest Kind k8s patch for each minor versions for e2e
2 parents 32a8c62 + f200f8f commit ec2013b

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

.github/workflows/e2e-test-kind.yaml

+30-16
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,40 @@ jobs:
4444
run: |
4545
IMAGE=velero VERSION=pr-test make container
4646
docker save velero:pr-test -o ./velero.tar
47+
# Create json of k8s versions to test
48+
# from guide: https://stackoverflow.com/a/65094398/4590470
49+
setup-test-matrix:
50+
runs-on: ubuntu-latest
51+
env:
52+
GH_TOKEN: ${{ github.token }}
53+
outputs:
54+
matrix: ${{ steps.set-matrix.outputs.matrix }}
55+
steps:
56+
- name: Set k8s versions
57+
id: set-matrix
58+
# everything excluding older tags. limits needs to be high enough to cover all latest versions
59+
# and test labels
60+
# grep -E "v[1-9]\.(2[5-9]|[3-9][0-9])" filters for v1.25 to v9.99
61+
# and removes older patches of the same minor version
62+
# awk -F. '{if(!a[$1"."$2]++)print $1"."$2"."$NF}'
63+
run: |
64+
echo "matrix={\
65+
\"k8s\":$(wget -q -O - "https://hub.docker.com/v2/namespaces/kindest/repositories/node/tags?page_size=50" | grep -o '"name": *"[^"]*' | grep -o '[^"]*$' | grep -v -E "alpha|beta" | grep -E "v[1-9]\.(2[5-9]|[3-9][0-9])" | awk -F. '{if(!a[$1"."$2]++)print $1"."$2"."$NF}' | sort -r | sed s/v//g | jq -R -c -s 'split("\n")[:-1]'),\
66+
\"labels\":[\
67+
\"Basic && (ClusterResource || NodePort || StorageClass)\", \
68+
\"ResourceFiltering && !Restic\", \
69+
\"ResourceModifier || (Backups && BackupsSync) || PrivilegesMgmt || OrderedResources\", \
70+
\"(NamespaceMapping && Single && Restic) || (NamespaceMapping && Multiple && Restic)\"\
71+
]}" >> $GITHUB_OUTPUT
72+
4773
# Run E2E test against all Kubernetes versions on kind
4874
run-e2e-test:
49-
needs: build
75+
needs:
76+
- build
77+
- setup-test-matrix
5078
runs-on: ubuntu-latest
5179
strategy:
52-
matrix:
53-
k8s:
54-
- 1.23.17
55-
- 1.24.17
56-
- 1.25.16
57-
- 1.26.13
58-
- 1.27.10
59-
- 1.28.6
60-
- 1.29.1
61-
labels:
62-
# labels are used to filter running E2E cases
63-
- Basic && (ClusterResource || NodePort || StorageClass)
64-
- ResourceFiltering && !Restic
65-
- ResourceModifier || (Backups && BackupsSync) || PrivilegesMgmt || OrderedResources
66-
- (NamespaceMapping && Single && Restic) || (NamespaceMapping && Multiple && Restic)
80+
matrix: ${{fromJson(needs.setup-test-matrix.outputs.matrix)}}
6781
fail-fast: false
6882
steps:
6983
- name: Check out the code

0 commit comments

Comments
 (0)