civo / terraform-provider-civo

Terraform Civo provider
https://www.civo.com
Mozilla Public License 2.0
71 stars 56 forks source link

[BUG] Updating the firewall in a talos cluster prevents you from seeing cluster details #334

Closed fernando-villalba closed 2 months ago

fernando-villalba commented 2 months ago

Description

Updating the firewall in a talos cluster prevents you from seeing cluster details

Reproducing the issue

  1. Using the following code

provider "civo" {
  region = "LON1"
}

resource "civo_firewall" "example" {
    name = "example-firewall"
    create_default_rules = true
    network_id = civo_network.example.id

}

resource "civo_firewall" "example2" {
    name = "example-firewall2"
    create_default_rules = true
    network_id = civo_network.example.id

}

resource "civo_network" "example" {
  label = "example-network1234"

}

# Query instance disk image
data "civo_disk_image" "debian" {
   filter {
        key = "name"
        values = ["debian-10"]
   }
}

resource "civo_kubernetes_cluster" "example" {
    name = "example-cluster"
    # applications = "argocd,linkerd:Linkerd with Dashboard & Jaeger"
    network_id = civo_network.example.id
    firewall_id = civo_firewall.example.id # change this after creation to civo_firewall.example2.id

    cluster_type = "talos"
    pools {
        label = "shop"
        size = "g4s.kube.small"
        node_count = 3
    }
}
  1. If you modify and apply changes for a firewall after creation, you get the following error:
image
  1. The cluster can no longer be accessed via the UI, getting the following:
image
  1. And if you try to get details in the CLI, you get the following, better error:
image

At this point, I am not sure if there is a fix for this broken cluster, at least not without contacting support

  1. Moreover, After this happens, terraform thinks the cluster does not exist any longer and tries to recreate it:
image
  1. Even though it still does:
image

Acceptance Criteria

fernando-villalba commented 2 months ago

This is an internal issue outside of the scope of terraform, closing here, but kept as reference to reproduce issue.