Skip to content

Commit cf376ec

Browse files
committed
test: use the first five chars of md5sum of unique workflow run identifier.
The tuple (repo, run_id, run_attempt) identifies a run, however this is too long for the terraform talos name. So we use this to generate a 5-digit hash instead of using random 3 digit ids which are prone to collisions. Signed-off-by: Tom Hadlaw <tom.hadlaw@isovalent.com>
1 parent b6e5546 commit cf376ec

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

.github/workflows/conformance-13-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
./create-ci-env.sh \
6161
--kube-proxy ${{ matrix.config.kube-proxy}} \
6262
--talos-version ${{ matrix.talos }} \
63-
--pr ${{ github.run_number }} \
63+
--pr "${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}" \
6464
--owner "isovalent/terraform-aws-talos"
6565
make apply
6666
- name: Install Cilium CLI

.github/workflows/conformance-13.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
./create-ci-env.sh \
133133
--kube-proxy ${{ matrix.config.kube-proxy}} \
134134
--talos-version ${{ matrix.talos }} \
135-
--pr ${{ github.run_number }} \
135+
--pr "${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" \
136136
--owner "isovalent/terraform-aws-talos"
137137
make apply
138138
- name: Install Cilium CLI

.github/workflows/conformance-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
./create-ci-env.sh \
5858
--kube-proxy ${{ matrix.config.kube-proxy}} \
5959
--talos-version ${{ matrix.talos }} \
60-
--pr ${{ github.run_number }} \
60+
--pr "${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_number}}-${{ github.run_attempt }}" \
6161
--owner "isovalent/terraform-aws-talos"
6262
make apply
6363
- name: Install Cilium CLI

.github/workflows/conformance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
./create-ci-env.sh \
120120
--kube-proxy ${{ matrix.config.kube-proxy}} \
121121
--talos-version ${{ matrix.talos }} \
122-
--pr ${{ github.run_number }} \
122+
--pr "${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" \
123123
--owner "isovalent/terraform-aws-talos"
124124
make apply
125125
- name: Install Cilium CLI

test/conformance/create-ci-env.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,15 @@ if [ -z "$kube_proxy" ] && [ -z "$talos_version" ] && [ -z "$owner" ]; then
8080
usage
8181
fi
8282

83-
84-
pr_name=$(head -c 15 <<< ${pr_name})
85-
num=$(head -c 3 <<< ${RANDOM})
83+
id=$(md5sum <<< ${pr_name} | head -c 5)
8684

8785
disable_kube_proxy=false
8886
if [ ${kube_proxy} == "false" ]; then
8987
disable_kube_proxy=true
9088
fi
9189

9290
cat > env.tfvars << EOF
93-
cluster_name = "talos-e2e-${pr_name}-${num}"
91+
cluster_name = "talos-e2e-${id}"
9492
region = "us-east-2"
9593
owner = "${owner}"
9694
talos_version = "${talos_version}"

0 commit comments

Comments
 (0)