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

Fix node drain by replacing deprecated --delete-local-data flag #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonas-be
Copy link

Currently, when running tofu destroy, the node drain fails with the following error:

module.k3s_cluster.null_resource.servers_label["cp1|environment"] (remote-exec): Connected!
module.k3s_cluster.null_resource.servers_drain["cp1"] (remote-exec): error: unknown flag: --delete-local-data
module.k3s_cluster.null_resource.servers_drain["cp1"] (remote-exec): See 'kubectl drain --help' for usage.
module.k3s_cluster.null_resource.servers_label["cp1|environment"] (remote-exec): node/cp1 unlabeled
module.k3s_cluster.null_resource.servers_label["cp1|environment"]: Destruction complete after 1s
╷
│ Error: remote-exec provisioner error
│
│   with module.k3s_cluster.null_resource.servers_drain["cp1"],
│   on .terraform/modules/k3s_cluster/server_nodes.tf line 268, in resource "null_resource" "servers_drain":
│  268:   provisioner "remote-exec" {
│
│ error executing "/tmp/terraform_902530670.sh": Process exited with status 1

This error is caused by the --delete-local-data flag, which has been deprecated and renamed to --delete-emptydir-data.

This PR renames this flag, which will fix the node drain errors.

Signed-off-by: Jonas-be <[email protected]>
@xunleii
Copy link
Owner

xunleii commented Jan 24, 2025

Hi @jonas-be, thanks for your PR. I will try to make a release this weekend and to change the minimal k3s version for this module (major release because of this breaking change).

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. If the pull request still needs attention, please leave a comment and it will be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants