-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resources loop #46
resources loop #46
Conversation
Reviewing and testing now. |
@@ -39,10 +39,11 @@ function backup_resource { | |||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is no longer required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and echo '---' > /tmp/${type}.yaml
also.
/tmp/${type}.yaml doesn't have any real content besides dashes.
I looked at restoration SOP, and it looks like once all .gz archives are unpacked, we are expecting "$NS-*" files. We should update SOP or update filenames and archive them without tmp/ folder. |
Yeah the sop needs an update as well but I could add the ns var into the file name as well |
4dee173
to
78b00b7
Compare
@matskiv sent a tiny update to remove the /tmp from the file path |
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)" > /tmp/${type}.${obj}.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we change output filename, to start with ${ns}-
, we won't need SOP update IMHO
78b00b7
to
c6fff91
Compare
Once merged lets get this into 1.4 as well |
still needs a final verification |
done | ||
(cd /tmp; find -name "*.yaml" | tar -cvzf "${dest}/archives/${ns}-${type}.yaml.gz" -T -) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This produces .tar.gz archive, and if one follows SOP and uses gunzip - it won't unpack this archive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok but all other components are using tar we should update the sop then
c6fff91
to
fd763b0
Compare
fd763b0
to
085c9f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@odra ok to merge, release and cherry pick |
Verification