-
Notifications
You must be signed in to change notification settings - Fork 0
fix local exec error with docs #106
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,9 +15,19 @@ resource "terraform_data" "destroyer" { | |
|
|
||
| command = <<-EOF | ||
| set -euo pipefail | ||
| nodeclaims=$(kubectl --kubeconfig <(echo "$${KUBECONFIG_DATA}") get nodeclaims -l "karpenter.sh/nodepool=$${NODEPOOL_NAME}" -o name) | ||
|
|
||
| if [ -z "$${KUBECONFIG_DATA}" ]; then | ||
| echo "Error: KUBECONFIG_DATA is empty" | ||
| exit 1 | ||
| fi | ||
|
|
||
| kubeconfig_file=$(mktemp) | ||
| echo "$${KUBECONFIG_DATA}" > "$${kubeconfig_file}" | ||
| trap "rm -f $${kubeconfig_file}" EXIT | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This trap line should happen before the write on the line above.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, i kinda guessed if doing everything in one line is causing the issue. I will wait for @jubrad to reply, incase he knows exact steps to repro this. Otherwise i would just get rid of this file change. |
||
|
|
||
| nodeclaims=$(kubectl --kubeconfig "$${kubeconfig_file}" get nodeclaims -l "karpenter.sh/nodepool=$${NODEPOOL_NAME}" -o name) | ||
| if [ -n "$${nodeclaims}" ]; then | ||
| echo "$${nodeclaims}" | xargs kubectl --kubeconfig <(echo "$${KUBECONFIG_DATA}") delete --wait=true | ||
| echo "$${nodeclaims}" | xargs kubectl --kubeconfig "$${kubeconfig_file}" delete --wait=true | ||
| fi | ||
| EOF | ||
| interpreter = ["/usr/bin/env", "bash", "-c"] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.