Skip to content

Commit

Permalink
Merge pull request #46 from odra/INTLY-2154_enmasse-obj-fix
Browse files Browse the repository at this point in the history
resources loop
  • Loading branch information
odra committed May 22, 2019
2 parents 0bf25b9 + 085c9f9 commit d8367f3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions image/tools/lib/component/resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ function backup_resource {
if [ "$?" -eq "0" ]; then
echo "==> backing up $type in $ns"
if [ "$loop" == "y" ]; then
echo '---' > /tmp/${type}.yaml
for obj in $(oc get ${type} -n ${ns} | tr -s ' ' | cut -d ' ' -f 1 | tail -n +2); do
echo '-' >> /tmp/${type}.yaml
echo "$(oc get ${type}/${obj} -n ${ns} -o yaml --export | sed 's/^/ /')" >> /tmp/${type}.yaml
cat /tmp/${type}.yaml | gzip > ${dest}/archives/${ns}-${type}.yaml.gz
rm -f /tmp/${type}.yaml
echo "$(oc get ${type}/${obj} -n ${ns} -o yaml --export)" > ${dest}/archives/${ns}-${type}.${obj}.yaml
done
else
oc get ${type} -n ${ns} -o yaml --export | gzip > ${dest}/archives/${ns}-${type}.yaml.gz
Expand Down

0 comments on commit d8367f3

Please sign in to comment.