Created
July 17, 2023 10:17
-
-
Save haarchri/8a7f6f5342499fc43ad60d33aa7c6a8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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