Skip to content

Commit 3ed77e7

Browse files
sayborasaanm
authored andcommitted
gha: Retrieve eks supported version via aws cli
The latest eksctl version didn't provide supported as part of version subcommand anymore. We can just use aws command directly as an alternative approach. ``` $ eksctl version -o json | jq -r '.EKSServerSupportedVersions[]' jq: error (at <stdin>:1): Cannot iterate over null (null) ``` Relates: eksctl-io/eksctl#8144 Signed-off-by: Tam Mach <tam.mach@cilium.io>
1 parent 7dc46ef commit 3ed77e7

2 files changed

Lines changed: 24 additions & 18 deletions

File tree

.github/workflows/conformance-aws-cni.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,26 @@ jobs:
121121
echo "Generated matrix:"
122122
cat /tmp/matrix.json
123123
124-
# We use latest eksctl just to fetch recent supported versions.
125-
# We don't use that eksctl to create cluster.
126-
# Eksctl has hardcoded list of supported versions in the binary.
127-
# This is hack until https://github.com/aws/containers-roadmap/issues/982 is resolved.
128-
- name: Install eksctl CLI
124+
- name: Set up AWS CLI credentials
125+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
126+
with:
127+
role-to-assume: ${{ secrets.AWS_PR_ASSUME_ROLE }}
128+
aws-region: us-west-1
129+
130+
- name: Run aws configure
129131
run: |
130-
curl -LO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz"
131-
sudo tar xzvfC eksctl_$(uname -s)_amd64.tar.gz /usr/bin
132-
rm eksctl_$(uname -s)_amd64.tar.gz
132+
aws configure set aws_access_key_id ${{ env.AWS_ACCESS_KEY_ID }}
133+
aws configure set aws_secret_access_key ${{ env.AWS_SECRET_ACCESS_KEY }}
134+
aws configure set aws_session_token ${{ env.AWS_SESSION_TOKEN }}
135+
aws configure set default.region ${{ env.AWS_REGION }}
133136
134137
- name: Filter Matrix
135138
id: set-matrix
136139
run: |
137140
cp /tmp/matrix.json /tmp/result.json
138141
jq -c '.include[]' /tmp/matrix.json | while read i; do
139142
VERSION=$(echo $i | jq -r '.version')
140-
eksctl version -o json | jq -r '.EKSServerSupportedVersions[]' > /tmp/output
143+
aws eks describe-cluster-versions | jq -r '.clusterVersions[].clusterVersion' > /tmp/output
141144
if grep -q -F $VERSION /tmp/output; then
142145
echo "Version $VERSION is supported"
143146
else

.github/workflows/conformance-eks.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,26 @@ jobs:
121121
echo "Generated matrix:"
122122
cat /tmp/matrix.json
123123
124-
# We use latest eksctl just to fetch recent supported versions.
125-
# We don't use that eksctl to create cluster.
126-
# Eksctl has hardcoded list of supported versions in the binary.
127-
# This is hack until https://github.com/aws/containers-roadmap/issues/982 is resolved.
128-
- name: Install eksctl CLI
124+
- name: Set up AWS CLI credentials
125+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
126+
with:
127+
role-to-assume: ${{ secrets.AWS_PR_ASSUME_ROLE }}
128+
aws-region: us-west-1
129+
130+
- name: Run aws configure
129131
run: |
130-
curl -LO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz"
131-
sudo tar xzvfC eksctl_$(uname -s)_amd64.tar.gz /usr/bin
132-
rm eksctl_$(uname -s)_amd64.tar.gz
132+
aws configure set aws_access_key_id ${{ env.AWS_ACCESS_KEY_ID }}
133+
aws configure set aws_secret_access_key ${{ env.AWS_SECRET_ACCESS_KEY }}
134+
aws configure set aws_session_token ${{ env.AWS_SESSION_TOKEN }}
135+
aws configure set default.region ${{ env.AWS_REGION }}
133136
134137
- name: Filter Matrix
135138
id: set-matrix
136139
run: |
137140
cp /tmp/matrix.json /tmp/result.json
138141
jq -c '.include[]' /tmp/matrix.json | while read i; do
139142
VERSION=$(echo $i | jq -r '.version')
140-
eksctl version -o json | jq -r '.EKSServerSupportedVersions[]' > /tmp/output
143+
aws eks describe-cluster-versions | jq -r '.clusterVersions[].clusterVersion' > /tmp/output
141144
if grep -q -F $VERSION /tmp/output; then
142145
echo "Version $VERSION is supported"
143146
else

0 commit comments

Comments
 (0)