pulumiverse / pulumi-talos

Pulumi provider for Talos
Mozilla Public License 2.0
38 stars 11 forks source link

Error while doing a patch in control plane #16

Closed paucampana closed 1 year ago

paucampana commented 1 year ago

Hello,

I am trying to remove "/cluster/apiServer/admissionControl/" from the control plane configuration using patches. As it is a field that is only present in control planes (and not in workers), while using the talosctl command I needed to use the flag --config-patch-control-plane

So,

So I would like to be available to do the same using the terraform provider, but it looks that I am having a similar error as the previous one:

talos_machine_configuration_controlplane.machineconfig_cp: Creating...
╷
│ Error: failure applying rfc6902 patches to talos machine config: remove operation does not apply: doc is missing path: "/cluster/apiServer/admissionControl": missing value
│
│   with talos_machine_configuration_controlplane.machineconfig_cp,
│   on talos-config.tf line 4, in resource "talos_machine_configuration_controlplane" "machineconfig_cp":
│    4: resource "talos_machine_configuration_controlplane" "machineconfig_cp" {

My terraform code:

resource "talos_machine_configuration_controlplane" "machineconfig_cp" {
  cluster_name     = "test"
  cluster_endpoint = "https://example-lb:443"
  machine_secrets  = talos_machine_secrets.machine_secrets.machine_secrets
  config_patches = [
    file("${path.module}/talos-patches/admissioncontroller.yaml")
  ]
  docs_enabled = false
  examples_enabled = false
  kubernetes_version = "1.23.9"
  talos_version = "v1.2.1"

}

talos-patches/admissioncontroller.yaml file content:

[
    {
        "op": "remove",
        "path": "/cluster/apiServer/admissionControl"
    }
]

It is a bug or I am doing something wrong?

More context: https://taloscommunity.slack.com/archives/CG25RPZNE/p1663105063165239

frezbo commented 1 year ago

you should be passing in the patches for the talos_machine_configuration_apply for the cp nodes.

frezbo commented 1 year ago

closing since this should have been in the tf provider repo