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

replace hardcoded namespace #45

merged 1 commit into from
May 21, 2019

Conversation

pb82
Copy link
Contributor

@pb82 pb82 commented May 21, 2019

Remove hardcoded namespace

@pb82 pb82 requested review from matskiv and odra May 21, 2019 08:29
@@ -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
Member

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
Member

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
Member

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

@pb82 pb82 merged commit 0bf25b9 into master May 21, 2019
@pb82 pb82 deleted the INTLY-2148 branch May 21, 2019 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants