From 96970766fb5b6fe7f18ad92a5f0b63d5fea6c786 Mon Sep 17 00:00:00 2001 From: Jaideep <79799016+jayfranco999@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:39:21 +0530 Subject: [PATCH] chore(updatecli):Track docker image digests for `ubuntu 22_04 AMD64` and `ubuntu 22_04 ARM64` (#1508) * chore(updatecli):Track docker image digests for ubuntu 22_04 AMD64 and ARM64 Signed-off-by: jayfranco999 * fixup Signed-off-by: jayfranco999 * fixup Signed-off-by: jayfranco999 --------- Signed-off-by: jayfranco999 Co-authored-by: Damien Duportal --- images-versions.yaml | 5 +++ sources.pkr.hcl | 2 +- .../docker-ubuntu-22-04-amd64-images.yml | 44 +++++++++++++++++++ .../docker-ubuntu-22-04-arm64-images.yml | 44 +++++++++++++++++++ 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml create mode 100644 updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml diff --git a/images-versions.yaml b/images-versions.yaml index f2741025b..c6d58082f 100644 --- a/images-versions.yaml +++ b/images-versions.yaml @@ -15,3 +15,8 @@ aws: "22.04": amd64: ami-00eb69d236edcfaf8 arm64: ami-039e419d24a37cb82 +docker: + ubuntu: + "22.04": + amd64: sha256:3d1556a8a18cf5307b121e0a98e93f1ddf1f3f8e092f1fddfd941254785b95d7 + arm64: sha256:7c75ab2b0567edbb9d4834a2c51e462ebd709740d1f2c40bcd23c56e974fe2a8 diff --git a/sources.pkr.hcl b/sources.pkr.hcl index d6a215a37..14de8a67b 100644 --- a/sources.pkr.hcl +++ b/sources.pkr.hcl @@ -74,7 +74,7 @@ source "azure-arm" "base" { # This source defines all the common settings for any Azure image (whatever Operating System) source "docker" "base" { - image = "${var.agent_os_type}:${var.agent_os_version}" + image = try("${var.agent_os_type}@${local.images_versions["docker"]["ubuntu"][var.agent_os_version][var.architecture]}", "N/A") # Persist image on local docker engine commit = true diff --git a/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml new file mode 100644 index 000000000..6f0dcd070 --- /dev/null +++ b/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml @@ -0,0 +1,44 @@ +--- +name: Bump docker `ubuntu 22_04 amd64` image version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastDockerDigest: + kind: dockerdigest + spec: + image: "ubuntu" + tag: "22.04" + architecture: "amd64" + +targets: + updateDigest: + name: Update docker `ubuntu 22_04 amd64` image version in locals + sourceid: lastDockerDigest + kind: yaml + scmid: default + spec: + file: ./images-versions.yaml + key: $.docker.ubuntu.'22.04'.amd64 + transformers: + - trimprefix: '22.04@' + +actions: + default: + kind: github/pullrequest + scmid: default + spec: + title: Bump docker `ubuntu 22_04 amd64` image version + description: "Follow up docker images for ubuntu 22_04 amd64" + labels: + - enhancement diff --git a/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml b/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml new file mode 100644 index 000000000..541885efa --- /dev/null +++ b/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml @@ -0,0 +1,44 @@ +--- +name: Bump docker `ubuntu 22_04 arm64` image version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastDockerDigest: + kind: dockerdigest + spec: + image: "ubuntu" + tag: "22.04" + architecture: "arm64" + +targets: + updateDigest: + name: Update docker `ubuntu 22_04 arm64` image version in locals + sourceid: lastDockerDigest + kind: yaml + scmid: default + spec: + file: ./images-versions.yaml + key: $.docker.ubuntu.'22.04'.arm64 + transformers: + - trimprefix: '22.04@' + +actions: + default: + kind: github/pullrequest + scmid: default + spec: + title: Bump docker `ubuntu 22_04 arm64` image version + description: "Follow up docker images for ubuntu 22_04 arm64" + labels: + - enhancement