Closed rptaylor closed 10 months ago
The output of the terraform provider upgrade, after which the bug was still present:
$ terraform init -upgrade
Initializing the backend...
Upgrading modules...
- compute in modules/compute
- ips in modules/ips
- network in modules/network
Initializing provider plugins...
- Finding latest version of hashicorp/template...
- Finding latest version of hashicorp/null...
- Finding terraform-provider-openstack/openstack versions matching "~> 1.17"...
- Using previously-installed hashicorp/template v2.2.0
- Installing hashicorp/null v3.2.2...
- Installed hashicorp/null v3.2.2 (signed by HashiCorp)
- Installing terraform-provider-openstack/openstack v1.53.0...
- Installed terraform-provider-openstack/openstack v1.53.0 (self-signed, key ID 4F80527A391BEFD2)
I have
This worked fine until I recently added the
"extra_groups" = "gpu_node"
line (feature from https://github.com/kubernetes-sigs/kubespray/pull/9211/files). This should just add "gpu_node" to kubespray_groups of one node. However when I terraform apply, it tries to remove the "no_floating" group from all nodes, even though floating_ip is still false!I've spent hours trying to reproduce this potential Terraform bug in a simpler/independent environment than Kubespray but have not been able to :( I tried Terraform versions 1.3.9, 1.4.7 and 1.6.6. I tried .terraform/providers/registry.terraform.io/terraform-provider-openstack/openstack/1.48.0 and also did
terraform init -upgrade
, upgrading the openstack provider version to 1.53.0. I tried creating openstack compute instances in a Terraform module using for_each and the same variable definitions and metadata definitionbut still could not reproduce it. There must be some extra complications in the Kubespray Terraform environment triggering this issue.
I did however try modifying the code to
which resulted in "FLOATING" being added, confirming that
if each.value.floating_ip == false
was evaluating to the opposite of what it should be!I also tried removing the
"extra_groups" = "gpu_node"
line and confirmed that this causes the bug to go away again, and the no_floating group comes back.Environment:
Kubespray version (commit) (
git rev-parse --short HEAD
): 7b936bc80