Skip to content

Commit 56ec15d

Browse files
committed
add flatcar image deletion to a top level catch block so even on an earlier failure the image gets cleaned up
1 parent 39efc02 commit 56ec15d

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/filters.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ kubeadm-full:
2727
# - templates/flavors/kubeadm/konnectivity/*
2828
kubeadm-flatcar:
2929
- templates/flavors/kubeadm/flatcar/*
30+
- e2e/capl-cluster-flavors/kubeadm-flatcar-vpcless-capl-cluster/*
3031

3132
#k3s:
3233
# - templates/flavors/k3s/default/*

e2e/capl-cluster-flavors/kubeadm-flatcar-vpcless-capl-cluster/chainsaw-test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ metadata:
1010
kubeadm-flatcar:
1111
flavors:
1212
spec:
13+
catch:
14+
- script:
15+
env:
16+
- name: TARGET_API
17+
value: api.linode.com
18+
- name: TARGET_API_VERSION
19+
value: v4
20+
- name: URI
21+
value: images
22+
- name: LINODE_REGION
23+
value: (env('LINODE_REGION'))
24+
content: |
25+
set -e
26+
# Get the latest version on Alpha channel.
27+
# NOTE: This can be changed to Beta or Stable when Akamai support will come on these channels.
28+
IMAGE_ID=$(cat image-id)
29+
curl -s --request DELETE \
30+
--url "https://${TARGET_API}/${TARGET_API_VERSION}/${URI}/${IMAGE_ID}" \
31+
--header "Authorization: Bearer ${LINODE_TOKEN}" \
32+
--header "accept: application/json"
1333
bindings:
1434
# A short identifier for the E2E test run
1535
- name: run

0 commit comments

Comments
 (0)