Missing image on the plan or apply stages after upgrading to 3.11.0
Upgrading 3.10.0 -> 3.11.0 results in no image being set and the runner defaulting to the default image of the runner when executing the plan or apply stages.
.gitlab-ci.yml:
.tf_base: &tf_base
tags:
- docker-controlnode
variables: &tf_vars
OS_AUTH_URL: xxxx
OS_SA_DOMAIN_NAME: xxxx
OS_PROJECT_DOMAIN_ID: xxxx
OS_DOMAIN_NAME: xxxx
OS_REGION_NAME: xxxx
OS_INTERFACE: xxxx
OS_PROJECT_NAME: xxxx
TZ: Europe/Amsterdam
include:
- component: gitlab.com/components/opentofu/validate-plan-apply@3.11.0
inputs:
version: 3.11.0
opentofu_version: 1.10.6
root_dir: terraform
state_name: sandbox
post_mr_plan_comment: true
stages:
- validate
- build
- deploy
- share
plan:
extends:
- .tf_base
apply:
interruptible: false
extends:
- .tf_base
before_script:
- apk add --update --no-cache ansible-core jq
artifacts:
dotenv: ...
after_script: ...
The validate and fmt stages work just fine (but we haven't extended these).
A diff between a rendered CI config shows that this has been removed from the configuration of the plan job:
image:
name: "$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:3.10.0-opentofu1.10.6-alpine"
This was added instead, but somehow doesn't end up merged into the plan job:
".plan:rootless:false":
image:
name: "$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:3.11.0-opentofu1.10.6-alpine"
".plan:rootless:true":
image:
name: "$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:3.11.0-opentofu1.10.6-alpine-rootless"
This appears to be the same for the apply stage.
I have tried explicitly setting the use_rootless_image input to false but this makes no difference.
If we explicitly add .plan:rootless:false or .apply:rootless:false to our extends section the jobs are working again. This was working fine in 3.10.0.