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

Move Path check into switch case #284

Merged
merged 2 commits into from
Dec 22, 2021
Merged

Move Path check into switch case #284

merged 2 commits into from
Dec 22, 2021

Conversation

Nalum
Copy link
Member

@Nalum Nalum commented Dec 20, 2021

Fix: #245

Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>
Comment on lines 265 to 269
if p, err := securejoin.SecureJoin(tmp, auto.Spec.Update.Path); err != nil {
return failWithError(err)
} else {
manifestsPath = p
}
Copy link
Member

@pjbgf pjbgf Dec 21, 2021

Choose a reason for hiding this comment

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

nit: else is redundant after a return.

Suggested change
if p, err := securejoin.SecureJoin(tmp, auto.Spec.Update.Path); err != nil {
return failWithError(err)
} else {
manifestsPath = p
}
p, err := securejoin.SecureJoin(tmp, auto.Spec.Update.Path);
if err != nil {
return failWithError(err)
}
manifestsPath = p

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @pjbgf 👍

Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @Nalum 🏅

@stefanprodan stefanprodan merged commit f82654d into fluxcd:main Dec 22, 2021
@Nalum Nalum deleted the issue-245 branch December 22, 2021 13:14
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.

Unnecessary conditions in the code
3 participants