vmware / terraform-provider-tanzu-mission-control

Terraform Provider for VMware Tanzu Mission Control
https://registry.terraform.io/providers/vmware/tanzu-mission-control/latest/docs
Mozilla Public License 2.0
37 stars 33 forks source link

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

Open dsputnikk opened 6 months ago

dsputnikk commented 6 months 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 6 months 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"}
dsputnikk commented 1 month ago

Hello my fellow tanzu wanderers lacking support from Broadcom :)

I've come back to this and figured both issues out.

For the first: I've now tried v1.4.5 and this has resolved. Perhaps a domain issue in the buyout

For the second: I needed to use the full package name instead of the short. eg: external-dns.tanzu.vmware.com instead of just external-dns

dsputnikk commented 1 month ago

I retract my statement.

The first issue is not resolved. Even with 1.4.5 I'm still getting 22: path_to_inline_values = var.path_to_inline_values │ │ An argument named "path_to_inline_values" is not expected here.

dsputnikk commented 1 month ago

OK. I'm confused.

I exhausted all my options for using the deprecated overlay_values. I could not supply a nested deployment.args map no matter how hard I tried.

I went back to path_to_inline_values and wound up on spec.go in the packageinstaller resource folder. "It is defined!" I thought. "Why would terraform complain".

In an effort to try and hack my way thru it, I downloaded this entire repo. Built it without modification and then proceeded to use it as specified in the development instructions. It worked!

Somehow, the spec did not make it into your latest build!