-
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
replace hardcoded namespace #45
Conversation
@@ -39,7 +39,7 @@ 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 | |||
echo "$(oc get ${type}/${obj} -n enmasse -o yaml --export | sed 's/^/ /')" >> /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 |
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.
There is still a bug in this part of backup. Not caused by @pb82 change, but I think we can fix it in the same PR.
We are exporting objects in a loop, but each step overrides previously exported object, so we end up just with the last one.
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.
should we name it /tmp/${type}.${obj}
(or something similar)?
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.
@odra yeah, that's probably cleanest option. Create all the tmp files and then gzip them into ${dest}/archives/${ns}-${type}.yaml.gz together
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.
I think we should merge this pr as it is and file a new ticket/pr for this other change which is more complex than just changin the ns var.
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.
okay, I'll create a JIRA and implement a fix
Remove hardcoded namespace