Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config parameters that use numbers try to re-apply config #507

Open
arif-ali opened this issue Jun 28, 2024 · 1 comment
Open

config parameters that use numbers try to re-apply config #507

arif-ali opened this issue Jun 28, 2024 · 1 comment
Labels
kind/bug indicates a bug in the project

Comments

@arif-ali
Copy link

Description

Below is what I get with terraform apply

  # juju_application.nova-cloud-controller will be updated in-place
  ~ resource "juju_application" "nova-cloud-controller" {
      ~ config            = {
          ~ "cpu-allocation-ratio"    = "2" -> "2.0"
          ~ "ram-allocation-ratio"    = "1" -> "1.0"
          ~ "worker-multiplier"       = "0" -> "0.25"
            # (8 unchanged elements hidden)
        }

I double checked, the variables that I am using are strings

Urgency

Annoying bug in our test suite

Terraform Juju Provider version

0.12.0

Terraform version

1.9.0

Juju version

3.4.3

Terraform Configuration(s)

variable worker-multiplier {
    type = string
    default = "0.25"
}

variable cpu-allocation-ratio {
    type = string
    default = "16.0"
}

variable ram-allocation-ratio {
    type = string
    default = "2.0"
}

resource "juju_application" "nova-cloud-controller" {
  name = "nova-cloud-controller"

  model = var.model-name

  charm {
    name     = "nova-cloud-controller"
    channel  = var.openstack-channel
    base     = var.default-base
  }

  units = var.num_units

  placement = "${join(",", sort([
    for res in juju_machine.ncc :
        res.machine_id
  ]))}"

  endpoint_bindings = [{
    space    = var.oam-space
  },{ 
    endpoint = "public"
    space    = var.public-space
  },{ 
    endpoint = "admin"
    space    = var.admin-space
  },{ 
    endpoint = "internal"
    space    = var.internal-space
  },{ 
    endpoint = "shared-db"
    space    = var.internal-space
  },{ 
    endpoint = "memcache"
    space    = var.internal-space
  }]  

  config = { 
      worker-multiplier = var.worker-multiplier
      openstack-origin  = var.openstack-origin
      region            = var.openstack-region
      vip               = var.vips["nova-cc"]
      network-manager   = "Neutron"
      console-access-protocol = "novnc"
      console-proxy-ip       = "local"
      use-internal-endpoints = "true"
      ram-allocation-ratio   = var.ram-allocation-ratio
      cpu-allocation-ratio   = var.cpu-allocation-ratio
      config-flags           = "scheduler_max_attempts=20"
  }
}

Reproduce / Test

terraform apply

then terraform plan or apply will try to change those 3 values

Debug/Panic Output

No response

Notes & References

No response

@arif-ali arif-ali added the kind/bug indicates a bug in the project label Jun 28, 2024
@hmlanigan
Copy link
Member

Per the schema, all application config is expected to be a map where both the key and value are strings. This is expected behavior which does differ from juju cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug indicates a bug in the project
Projects
None yet
Development

No branches or pull requests

2 participants