rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
253 stars 216 forks source link

[BUG] Rancher2_app_v2 does not force namespace creation #1282

Open boris-stojnev opened 6 months ago

boris-stojnev commented 6 months ago

Rancher Server Setup

User Information

Provider Information

Describe the bug

If namespace specified in the rancher2_app_v2 doesn’t exist, the namespace should be created as mention in the documentation namespace - (Required/ForceNew) The namespace of the app v2 (string) https://registry.terraform.io/providers/rancher/rancher2/latest/docs/resources/app_v2#namespace

To Reproduce

Install rancher-monitoring:

resource "rancher2_app_v2" "monitoring" {
  cluster_id = "local"
  name = "rancher-monitoring"
  namespace = "cattle-monitoring-system"
  repo_name = "rancher-charts"
  chart_name = "rancher-monitoring"
  chart_version = "102.0.2+up40.1.2"
  values = file("values.yaml")
}

Actual Result

The terraform apply is failing with the following error Error: failed to install app v2: Bad response statusCode [500]. Status [500 Internal Server Error]. Body: [message=failed to wait for roles to be populated, code=ServerError] from [[https://xxx/v1/catalog.cattle.io.clusterrepos/rancher-charts?action=install]](https://xxx/v1/catalog.cattle.io.clusterrepos/rancher-charts?action=install])