When the terraform-checks' Apply terraform runs without a model input, it fails with the following message:
ERROR cannot create model "testing": a namespace called "testing" already exists on this k8s cluster. Please pick a different model name.
This is caused by:
The terraform-apply workflow creates a juju model that defaults to testing
At the same time, the workflow calls charmed-kubernetes/actions-operator to setup the testing environment on a step before. This action already creates a model called testing
Because of the above, the workflow fails to create a model that already exists
Run juju add-model testing
juju add-model testing
shell: /usr/bin/bash -e {0}
env:
CONTROLLER_NAME: github-pr-103aa-microk8s
ERROR cannot create model "testing": a namespace called "testing" already exists on this k8s cluster. Please pick a different model name.
Error: Process completed with exit code 1.
Workaround
Define a model name different than testing when calling the wf:
Bug Description
When the
terraform-checks' Apply terraform
runs without amodel
input, it fails with the following message:This is caused by:
terraform-apply
workflow creates a juju model that defaults totesting
charmed-kubernetes/actions-operator
to setup the testing environment on a step before. This action already creates a model calledtesting
To Reproduce
Check the CI that fails, for example this
Environment
CI for Terraform
Relevant Log Output
Workaround
Define a model name different than
testing
when calling the wf:Potential solution
Change the default model name of the
terraform-apply
workflow fromtesting
totf-testing