From 338ed05dd9d2fd0cd75182d262c9af4894780b64 Mon Sep 17 00:00:00 2001 From: Timo Furrer <tfurrer@gitlab.com> Date: Tue, 16 Jan 2024 10:20:37 +0100 Subject: [PATCH] Fix image version --- .gitlab-ci.yml | 8 ++++++-- templates/full-pipeline.yml | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61ae21e..1d94bea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,7 +61,11 @@ gitlab-opentofu-image:deploy: entrypoint: [""] variables: RELEASE_IMAGE_NAME: "$CI_REGISTRY_IMAGE/gitlab-opentofu" - RELEASE_SEMVER: "${CI_COMMIT_TAG}+opentofu-${OPENTOFU_VERSION}" + # OCI image tags are not compatible with semver, specifically the build metadata part + # indicated with a `+` sign, see https://github.com/distribution/distribution/issues/1201 + # We use a dash `-` here, instead of the `+`. + # This may be problematic, because it indicates a semver prerelease. + RELEASE_SEMVER: "${CI_COMMIT_TAG}-opentofu${OPENTOFU_VERSION}" before_script: - crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" script: @@ -77,7 +81,7 @@ gitlab-opentofu-image:latest:deploy: variables: OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION RELEASE_IMAGE_NAME: "$CI_REGISTRY_IMAGE/gitlab-opentofu" - RELEASE_SEMVER: "${CI_COMMIT_TAG}+opentofu" + RELEASE_SEMVER: "${CI_COMMIT_TAG}-opentofu" before_script: - crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" script: diff --git a/templates/full-pipeline.yml b/templates/full-pipeline.yml index 0771ad3..9a936a5 100644 --- a/templates/full-pipeline.yml +++ b/templates/full-pipeline.yml @@ -27,7 +27,10 @@ spec: # Images gitlab_opentofu_image: - default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu-$[[ inputs.opentofu_version ]]' + # FIXME: This should reference the component tag that is used. + # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 + # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:latest' description: 'Image name of the gitlab-opentofu image' # Configuration -- GitLab