Skip to content

unable to wipe all partitions of machine on destroy #284

@banthalabs

Description

@banthalabs

Using this example:

resource "talos_machine_configuration_apply" "this" {
  client_configuration        = talos_machine_secrets.this.client_configuration
  machine_configuration_input = data.talos_machine_configuration.this.machine_configuration
  node                        = var.node_ip

  on_destroy = {
    graceful = false
    reboot = true
    reset = true
  }
}

On destroy, when setting reset to true, it only wipes the ephemeral and state partitions which is the equivalent of this command.
talosctl reset --graceful=false --reboot=true --system-labels-to-wipe EPHEMERAL,STATE

However, I want to be able to wipe all partitions on destroy which is the equivalent of this command.
talosctl reset --graceful=false --reboot=true

I noticed there was a previous issue that changed the default behavior of reset.
#205

Just like the talosctl command, I'd like to be able to specify what system labels to wipe. Perhaps another field here would be helpful or something similar to below.

  on_destroy = {
    graceful = false
    reboot = true
    reset = true
    system_labels_to_wipe = ["EPHEMERAL","STATE","u-local-volume"]
  }

The DEFAULT behavior should also match the talosctl command. If system_labels_to_wipe option is not specified or the list is empty, it'll wipe all partitions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions