Skip to content
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

Merged
merged 1 commit into from
May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion image/tools/lib/component/resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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.

Copy link
Contributor

@odra odra May 21, 2019

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)?

Copy link
Contributor

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

Copy link
Contributor

@odra odra May 21, 2019

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.

Copy link
Contributor

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

rm -f /tmp/${type}.yaml
done
Expand Down