Created
April 28, 2021 02:52
-
-
Save iamnoah/0e04d162373ec5df43e02e3fff210083 to your computer and use it in GitHub Desktop.
Convert ArgoCD source overrides into the equivalent kustomization.yml
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 | |
cd $1 || exit 1 | |
to_json() { | |
ruby -ryaml -rjson -e 'YAML.load_stream(ARGF) do |doc| puts JSON.generate(doc) end' | |
} | |
(for override in .argocd-source*.yaml | |
do | |
to_json < $override | |
done) | jq --raw-output --slurp '.[].kustomize.images[]' | xargs -n 1 kustomize edit set image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment