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: temporary files written to '/dev/shm' not cleaned up (#568) #569

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

jgwest
Copy link
Member

@jgwest jgwest commented Apr 11, 2024

Fixes #568

See parent issue for details of the problem

This PR:

  • ctl.go: Adds a call to DeleteFile to handle the (rare) case where WriteKubeConfig fails.
  • resource_ops.go: Moves defer io.DeleteFile(...) call to handle the (rare) case where Write or Close fail.

Admittedly, these are likely to be rare: it's unlikely that writing to a file would fail, when that file was already successfully created earlier in the function.

Copy link

sonarcloud bot commented Apr 11, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
2.5% Duplication on New Code

See analysis details on SonarCloud

@jgwest jgwest changed the title fix: fix temporary files written to '/dev/shm' not cleaned up (#568) fix: temporary files written to '/dev/shm' not cleaned up (#568) Apr 11, 2024
Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants