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

Add Missing file.Close() calls #2761

Merged
merged 1 commit into from
Feb 8, 2022
Merged

Add Missing file.Close() calls #2761

merged 1 commit into from
Feb 8, 2022

Conversation

martinmaly
Copy link
Contributor

Calls to close files were missing in a couple of places

Calls to close files were missing in a couple of places
@@ -177,6 +177,7 @@ func GetValidatedFnConfigFromPath(pkgPath types.UniquePath, configPath string) (
if err != nil {
return nil, fmt.Errorf("functionConfig must exist in the current package")
}
defer file.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice side effect of turning render code into library :)

So far we never had to care about this because this code was primarily consumed in the CLI code, but now it gets consumed in a long running process so we discover these.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We found this one because some filesystem implementations are more sensitive to closing files :)

@martinmaly martinmaly merged commit 5169954 into kptdev:main Feb 8, 2022
@martinmaly martinmaly deleted the fs branch February 8, 2022 22:27
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

2 participants