Created
December 18, 2018 02:36
-
-
Save aarongorka/80c049f39be25bd7a14a8a2cc98d05af to your computer and use it in GitHub Desktop.
A wrapper script to make `kubectl patch` idempotent
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
#!/usr/bin/env bash | |
set +e | |
result="$(kubectl patch "$@")" | |
code="$?" | |
if [[ "$code" != "0" && "$result" == "* not patched" ]]; then | |
echo "$result" 1>&2 | |
exit "$code" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment