Skip to content

Instantly share code, notes, and snippets.

@haarchri
Created July 17, 2023 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haarchri/8a7f6f5342499fc43ad60d33aa7c6a8a to your computer and use it in GitHub Desktop.
Save haarchri/8a7f6f5342499fc43ad60d33aa7c6a8a to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
uidpath=$(kubectl get cluster.container.gcp.upbound.io/nodepool -o jsonpath='{.metadata.uid}')
echo $uidpath
kubectl get pods -n crossplane-system | grep "provider-gcp" | awk {'print $1'} | xargs -I% kubectl exec -it % -n crossplane-system -- /bin/bash -c "cd /tmp/$uidpath/; sed -i 's/\"lifecycle\":{\"prevent_destroy\":true},//g' main.tf.json; terraform init; terraform plan"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment