Skip to content

Instantly share code, notes, and snippets.

@iamnoah
Created April 28, 2021 02:52
Show Gist options
  • Save iamnoah/0e04d162373ec5df43e02e3fff210083 to your computer and use it in GitHub Desktop.
Save iamnoah/0e04d162373ec5df43e02e3fff210083 to your computer and use it in GitHub Desktop.
Convert ArgoCD source overrides into the equivalent kustomization.yml
#!/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