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

Restore Log Entry Clarification #1152

Closed
wants to merge 1 commit into from

Conversation

rdodev
Copy link

@rdodev rdodev commented Jan 9, 2019

Fixes #1142

Feel free to close if you want to wait for an outsider newbie who wants to take it.

Signed-off-by: Ruben Orduz <orduzr@vmware.com>
@@ -848,6 +848,7 @@ func (ctx *context) restoreResource(resource, namespace, resourcePath string) (a
addToResult(&warnings, namespace, e)
}
}
ctx.log.Infof("Unable to restore %s: %v because it already exists and is identical to the backed up copy", obj.GroupVersionKind().Kind, name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to go into an else block, right? Otherwise, there are a couple of cases from the "not equal" if block above that will fall through and hit this, which will be incorrect. If I'm reading it correctly the continue should remain outside the else since we want to continue for any case where we hit an AlreadyExists error.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, hmmm, good point.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which of 3 if statements would it be more pertinent to attach the else clause to? You think it might be worth refactoring by joining the 3 ifseses by else if and then finally else?

@ncdc
Copy link
Contributor

ncdc commented Jan 10, 2019

@rdodev since you're ok closing this, let's go with the new contributor PR #1153 😄 thanks!

@ncdc ncdc closed this Jan 10, 2019
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.

Restore log needs more clarity when object already exists and isn't different
3 participants