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

unset ovh_cloud_project_kube.version forces recreation #204

Closed
0xErnie opened this issue Jun 23, 2021 · 5 comments
Closed

unset ovh_cloud_project_kube.version forces recreation #204

0xErnie opened this issue Jun 23, 2021 · 5 comments

Comments

@0xErnie
Copy link

0xErnie commented Jun 23, 2021

Terraform Version

Terraform v1.0.0
on darwin_amd64
+ provider registry.terraform.io/ovh/ovh v0.13.0
+ provider registry.terraform.io/terraform-provider-openstack/openstack v1.42.0

Affected Resource(s)

Please list the resources as a list, for example:

  • ovh_cloud_project_kube
  • ovh_cloud_project_kube_nodepool

Terraform Configuration Files

provider "ovh" {
  endpoint           = "ovh-eu"
  application_key    = REMOVED
  application_secret = REMOVED
  consumer_key       = REMOVED
}
resource "ovh_cloud_project_kube" "mykube" {
  service_name       = REMOVED
  name               = "management"
  region             = "GRA7"
  private_network_id = REMOVED
}

resource "ovh_cloud_project_kube_nodepool" "pool" {
  service_name   = REMOVED
  kube_id        = ovh_cloud_project_kube.mykube.id
  name           = "pool001"
  flavor_name    = "b2-7"
  anti_affinity  = true
  monthly_billed = false
  desired_nodes  = 3
  max_nodes      = 3
  min_nodes      = 3
}

Expected Behavior

After the first terraform apply there should be no changes to the infrastructure if we run it again.

Actual Behavior

terraform detects that the version of the cluster is "1.20" instead of null so it wants to receate the hole cluster.

  # ovh_cloud_project_kube.mykube must be replaced
-/+ resource "ovh_cloud_project_kube" "mykube" {
      ~ control_plane_is_up_to_date = true -> (known after apply)
      ~ id                          = "REMOVED" -> (known after apply)
      ~ is_up_to_date               = true -> (known after apply)
      ~ kubeconfig                  = (sensitive value)
        name                        = "management"
      ~ next_upgrade_versions       = [] -> (known after apply)
      ~ nodes_url                   = "REMOVED" -> (known after apply)
      ~ status                      = "READY" -> (known after apply)
      ~ update_policy               = "ALWAYS_UPDATE" -> (known after apply)
      ~ url                         = "REMOVED" -> (known after apply)
      - version                     = "1.20" -> null # forces replacement
        # (3 unchanged attributes hidden)
    }

  # ovh_cloud_project_kube_nodepool.pool must be replaced
-/+ resource "ovh_cloud_project_kube_nodepool" "pool" {
      ~ available_nodes  = 3 -> (known after apply)
      ~ created_at       = "2021-06-23T08:52:45Z" -> (known after apply)
      ~ current_nodes    = 3 -> (known after apply)
      ~ flavor           = "b2-7" -> (known after apply)
      ~ id               = "REMOVED" -> (known after apply)
      ~ kube_id          = "REMOVED" -> (known after apply) # forces replacement
        name             = "pool001"
      ~ project_id       = "REMOVED" -> (known after apply)
      ~ size_status      = "CAPACITY_OK" -> (known after apply)
      ~ status           = "READY" -> (known after apply)
      ~ up_to_date_nodes = 3 -> (known after apply)
      ~ updated_at       = "2021-06-23T08:56:18Z" -> (known after apply)
        # (8 unchanged attributes hidden)
    }

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. terraform apply

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here?

@0xErnie 0xErnie changed the title empty ovh_cloud_project_kube version forces recreation unset ovh_cloud_project_kube.version forces recreation Jun 23, 2021
@yanndegat
Copy link
Collaborator

hi @0xErnie

thanks for reporting this. this is strange as we have released a fix in v0.13.0 with a proper functional test regarding this scenario.

we're going to investigate further.

meanwhile, you can use the lifecycle ... ignore_changes = [version] trick

regards

@yanndegat
Copy link
Collaborator

hi @0xErnie

FYI, i've logged an issue on the terraform repo. (hashicorp/terraform#29028)
Other issues have already been logged regarding the notable change introduced by terraform 0.15.4
(see: https://github.com/hashicorp/terraform/blob/v0.15/CHANGELOG.md)

AFAIK, they are still open issues, so i would suggest to stick to terraform 0.15.3 for the moment.

hashicorp/terraform#28776
hashicorp/terraform#28803

@yanndegat
Copy link
Collaborator

hi @0xErnie

i finally found the root cause of my issue. explaining why i've been misleaded several times.
there's been an issue during the release of the v0.13.0 version of the provider.

it has been released 2 times:

once without the patch fixing the version, once with it. But the second release failed to update the registry and overwrite the first one.
so the v0.13.0 tag on the repository is not reflecting the produced binary on the registry.

you should either pull the v0.13.1 version which properly includes the patchset or upgrade to v0.14.0

regards

is this ok for you?

@yanndegat
Copy link
Collaborator

hi @0xErnie

FYI, i've logged an issue on the terraform repo. (hashicorp/terraform#29028)
Other issues have already been logged regarding the notable change introduced by terraform 0.15.4
(see: https://github.com/hashicorp/terraform/blob/v0.15/CHANGELOG.md)

AFAIK, they are still open issues, so i would suggest to stick to terraform 0.15.3 for the moment.

hashicorp/terraform#28776
hashicorp/terraform#28803

this is a wrong analysis

@0xErnie
Copy link
Author

0xErnie commented Jul 12, 2021

Can not verify the soluton since we decided to stop using managed k8s but this seems to be fixed.
Thank you!

@0xErnie 0xErnie closed this as completed Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants