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

fix: golangci-lint error #191

Merged
merged 1 commit into from
Apr 26, 2024
Merged

fix: golangci-lint error #191

merged 1 commit into from
Apr 26, 2024

Conversation

FrankYang0529
Copy link
Contributor

Which issue(s) this PR fixes:

longhorn/longhorn#7448

What this PR does / why we need it:

Special notes for your reviewer:

Additional documentation or context

Copy link
Member

@innobead innobead left a comment

Choose a reason for hiding this comment

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

LGTM except one comment.

@@ -163,7 +163,9 @@ func getUpdatedGaneshConfig(config []byte) []byte {
LogPath: logPath,
}

template.Must(template.New("Ganesha_Config").Parse(string(config))).Execute(&tmplBuf, tmplVals)
if err := template.Must(template.New("Ganesha_Config").Parse(string(config))).Execute(&tmplBuf, tmplVals); err != nil {
logrus.WithError(err).Fatal("Failed to parse ganesha config")
Copy link
Member

Choose a reason for hiding this comment

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

Let's return the error to let the caller handle instead of failing the program here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this function doesn't return error orginally, I update to log a warning message here. We can see whether to improve it if this error happens frequently.

Copy link
Member

Choose a reason for hiding this comment

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

Signed-off-by: PoAn Yang <poan.yang@suse.com>
@innobead innobead merged commit 2190a31 into longhorn:master Apr 26, 2024
6 checks passed
@FrankYang0529 FrankYang0529 deleted the LH-7448 branch April 26, 2024 09:29
@FrankYang0529
Copy link
Contributor Author

@mergify backport v1.6.x

Copy link

mergify bot commented May 13, 2024

backport v1.6.x

✅ Backports have been created

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.

2 participants