spotinst / terraform-spotinst-ocean-controller

A Terraform module to install Ocean Controller.
https://registry.terraform.io/modules/spotinst/ocean-controller/spotinst
Apache License 2.0
12 stars 17 forks source link

Issue with the "optional" argument #3

Closed JohnMops closed 4 years ago

JohnMops commented 4 years ago

Hi,

This is the first time we get this error without an changes.

Error: Unsupported argument

on .terraform/modules/spotinst_elasticgroup.ocean-controller/main.tf line 320, in resource "kubernetes_deployment" "this": 320: optional = true

An argument named "optional" is not expected here.

Error: Unsupported argument

on .terraform/modules/spotinst_elasticgroup.ocean-controller/main.tf line 332, in resource "kubernetes_deployment" "this": 332: optional = true

An argument named "optional" is not expected here.

Error: Unsupported argument

on .terraform/modules/spotinst_elasticgroup.ocean-controller/main.tf line 343, in resource "kubernetes_deployment" "this": 343: optional = true

An argument named "optional" is not expected here.

Error: Unsupported argument

on .terraform/modules/spotinst_elasticgroup.ocean-controller/main.tf line 355, in resource "kubernetes_deployment" "this": 355: optional = true

An argument named "optional" is not expected here.

When commenting those arguments, everything works as expected.

JohnMops commented 4 years ago

I can't seem to find the go code for this module. From the error, i can see that the "optional" flag is no longer expected in those blocks

liranp commented 4 years ago

You can find the code here:

Anyway, it works fine for me:

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:
  [REDACTED]

  # module.ocean-controller.kubernetes_deployment.this will be created
  + resource "kubernetes_deployment" "this" {
      [REDACTED]

      + spec {
          [REDACTED]

          + template {

              + spec {
                  [REDACTED]

                  + container {
                      [REDACTED]

                      + env {
                          + name = "SPOTINST_TOKEN"

                          + value_from {

                              + secret_key_ref {
                                  + key      = "token"
                                  + name     = "spotinst-kubernetes-cluster-controller"
                                  + optional = true
                                }
                            }
                        }
                      + env {
                          + name = "SPOTINST_ACCOUNT"

                          + value_from {

                              + secret_key_ref {
                                  + key      = "account"
                                  + name     = "spotinst-kubernetes-cluster-controller"
                                  + optional = true
                                }
                            }
                        }
                      + env {
                          + name = "SPOTINST_TOKEN_LEGACY"

                          + value_from {
                              + config_map_key_ref {
                                  + key      = "spotinst.token"
                                  + name     = "spotinst-kubernetes-cluster-controller-config"
                                  + optional = true
                                }
                            }
                        }
                      + env {
                          + name = "SPOTINST_ACCOUNT_LEGACY"

                          + value_from {
                              + config_map_key_ref {
                                  + key      = "spotinst.account"
                                  + name     = "spotinst-kubernetes-cluster-controller-config"
                                  + optional = true
                                }
                            }
                        }

                        [REDACTED]
                    }

                    [REDACTED]
                }
            }
        }
    }

  [REDACTED]

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

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

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

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

module.ocean-controller.kubernetes_secret.this: Creating...
module.ocean-controller.kubernetes_config_map.this: Creating...
module.ocean-controller.kubernetes_service_account.this: Creating...
module.ocean-controller.kubernetes_cluster_role_binding.this: Creating...
module.ocean-controller.kubernetes_cluster_role.this: Creating...
module.ocean-controller.kubernetes_deployment.this: Creating...

[REDACTED]

Apply complete! Resources: 6 added, 0 changed, 0 destroyed.

Closing.