vmware / terraform-provider-tanzu-mission-control

Terraform provider to manage resources of Tanzu Mission Control
Mozilla Public License 2.0
39 stars 31 forks source link

path_to_inline_values not actually supported in tanzu-package-installer #403

Open dsputnikk opened 1 month ago

dsputnikk commented 1 month ago

Describe the bug

I'm using:

Terraform v1.8.4
on linux_amd64
+ provider registry.terraform.io/vmware/tanzu-mission-control v1.4.4

I have a resource like this:

resource "tanzu-mission-control_package_install" "package_install" {
  name      = var.package_name
  namespace = var.namespace

  scope {
    cluster {
      name                    = var.cluster_name
      provisioner_name        = var.provisioner_name
      management_cluster_name = var.management_cluster_name
    }
  }

  spec {
    package_ref {
      package_metadata_name = var.package_name

      version_selection {
        constraints = var.package_version
      }
    }
    path_to_inline_values = var.inline_values
  }
}

However terraform plan comes back with:

└─[$] <> terraform plan            
╷
│ Error: Unsupported argument
│ 
│   on tkg-packages/main.tf line 21, in resource "tanzu-mission-control_package_install" "package_install":
│   21:     path_to_inline_values = var.inline_values
│ 
│ An argument named "path_to_inline_values" is not expected here.

THe only docs I've found is this:

https://github.com/vmware/terraform-provider-tanzu-mission-control/blob/d9cc1f4e9d7abed257b2a0d97ed41de16c83580e/docs/resources/package_install.md

which clearly seem to state it should be there. And I'm on the latest provider.

Reproduction steps

  1. Attempt to provision via terraform a package resource
  2. Follow docs on using path_to_inline_values
  3. Error ...

Expected behavior

terraform plan should be aware this is a legitimate value?

Additional context

No response

dsputnikk commented 1 month ago

Furthermore, I can't get any official Tanzu plugins to install thru this.

Terraform will perform the following actions:

  # module.tkg-test-uat_pkg_exdns.tanzu-mission-control_package_install.package_install will be created
  + resource "tanzu-mission-control_package_install" "package_install" {
      + id        = (known after apply)
      + name      = "external-dns"
      + namespace = "external-dns"
      + status    = (known after apply)

      + scope {
          + cluster {
              + management_cluster_name = "vxrail-supervisor"
              + name                    = "tkg-test-uat"
              + provisioner_name        = "tanzu-simcheck"
            }
        }

      + spec {
          + inline_values      = (sensitive value)
          + role_binding_scope = (known after apply)

          + package_ref {
              + package_metadata_name = "external-dns"

              + version_selection {
                  + constraints = "v0.13.6+vmware.1-tkg.1"
                }
            }
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.tkg-test-uat_pkg_exdns.tanzu-mission-control_package_install.package_install: Creating...
╷
│ Error: Unable to create Tanzu Mission Control cluster package install entry, name : external-dns: POST request failed with status : 400 Bad Request, response: {"error":"package name or version not found","code":3,"message":"package name or version not found"}
│ 
│   with module.tkg-test-uat_pkg_exdns.tanzu-mission-control_package_install.package_install,
│   on tkg-packages/main.tf line 1, in resource "tanzu-mission-control_package_install" "package_install":
│    1: resource "tanzu-mission-control_package_install" "package_install" {
│ 

I've tried all the versions I can find from "tanzu packages available list". I've also tried with cert-manager. Same result.

POST comes back saying 'package name or version not found'

If I use package_name = "external-dns.tanzu.vmware.com" I get:

 Error: Unable to create Tanzu Mission Control cluster package install entry, name : external-dns.tanzu.vmware.com: POST request failed with status : 400 Bad Request, response: {"error":"invalid CreateInstallRequest.Install: embedded message failed validation | caused by: invalid Install.FullName: embedded message failed validation | caused by: invalid FullName.Name: value must be a valid Tanzu name | caused by: only alphanumeric characters and '-' are allowed in name","code":3,"message":"invalid CreateInstallRequest.Install: embedded message failed validation | caused by: invalid Install.FullName: embedded message failed validation | caused by: invalid FullName.Name: value must be a valid Tanzu name | caused by: only alphanumeric characters and '-' are allowed in name"}