Skip to content

Commit 824f40e

Browse files
committed
tests: Suffix image version
While boskos will reap most resources for us, it doesn't reap images [1]. This has resulted in us using the same image for who knows how long at this point. Stick with Ubuntu 22.04 (which we've been using all along) and encode the Ubuntu version to prevent us picking up other version by mistake. We can switch to Ubuntu 24.04 when we move to Dalmatian or Epoxy. [1] https://github.com/kubernetes-sigs/boskos/blob/5993cef5a1c719c33c0936d416b7d935058e1204/cmd/janitor/gcp_janitor.py#L46-L88 Signed-off-by: Stephen Finucane <[email protected]>
1 parent 2b839f6 commit 824f40e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/scripts/create-gce-vm.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,18 @@ main() {
9191

9292
case "${FLAVOR}" in
9393
"default")
94-
if ! gcloud compute disks describe devstack-${FLAVOR} --zone "${GCP_ZONE}" > /dev/null 2>&1;
94+
local disk_name="devstack-${FLAVOR}-ubuntu2204"
95+
if ! gcloud compute disks describe "${disk_name}" --zone "${GCP_ZONE}" > /dev/null 2>&1;
9596
then
96-
gcloud compute disks create devstack-${FLAVOR} \
97-
--image-project ubuntu-os-cloud --image-family ubuntu-2404-lts-amd64 \
97+
gcloud compute disks create "${disk_name}" \
98+
--image-project ubuntu-os-cloud --image-family ubuntu-2204-lts \
9899
--zone "${GCP_ZONE}"
99100
fi
100101

101-
if ! gcloud compute images describe devstack-${FLAVOR} > /dev/null 2>&1;
102+
if ! gcloud compute images describe "${disk_name}" > /dev/null 2>&1;
102103
then
103-
gcloud compute images create devstack-${FLAVOR} \
104-
--source-disk devstack-${FLAVOR} --source-disk-zone "${GCP_ZONE}" \
104+
gcloud compute images create "${disk_name}" \
105+
--source-disk "${disk_name}" --source-disk-zone "${GCP_ZONE}" \
105106
--licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
106107
fi
107108
;;
@@ -115,7 +116,7 @@ main() {
115116
then
116117
gcloud compute instances create devstack \
117118
--zone "${GCP_ZONE}" \
118-
--image devstack-${FLAVOR} \
119+
--image "${disk_name}" \
119120
--boot-disk-size 30G \
120121
--boot-disk-type pd-ssd \
121122
--can-ip-forward \

0 commit comments

Comments
 (0)