Skip to content

fix: empty tmp dir instead of removing it #2203

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

Conversation

banjoh
Copy link
Member

@banjoh banjoh commented May 28, 2025

What this PR does / why we need it:

The tmp directory is used for a number of things including when edittig k8s resources using kubectl edit. Removing it after running commands will lead to failures in certain situations.

Which issue(s) this PR fixes:

sc-124106

Does this PR require a test?

Unit test added

Does this PR require a release note?

Empty <data-dir>/tmp dir instead of deleting in when cleaning up after running commands

Does this PR require documentation?

NONE

The tmp directory is used for a number of things including
when editig k8s resources using kubectl edit. Removing it
after running commands will lead to failures in certain
commands.

Signed-off-by: Evans Mungai <[email protected]>
Copy link

github-actions bot commented May 28, 2025

This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID.

Online Installer:

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/appver-dev-a302013" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Airgap Installer (may take a few minutes before the airgap bundle is built):

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci-airgap/appver-dev-a302013?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

@@ -27,7 +27,23 @@ func Get() *ecv1beta1.RuntimeConfigSpec {
}

func Cleanup() {
os.RemoveAll(EmbeddedClusterTmpSubDir())
emptyTmpDir()
Copy link
Member

Choose a reason for hiding this comment

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

we already have helpers.RemoveAll. can you please use that instead? it also has tests

@banjoh banjoh force-pushed the evansmungai/sc-124106/collecting-a-support-bundle-deletes-tmp-directory branch from 0c0d7fb to 181dce8 Compare May 28, 2025 14:21
Signed-off-by: Evans Mungai <[email protected]>
@sgalsaleh
Copy link
Member

Merging as change is unrelated and tests are flaky right now.

@sgalsaleh sgalsaleh merged commit 852e871 into main May 29, 2025
106 of 127 checks passed
@sgalsaleh sgalsaleh deleted the evansmungai/sc-124106/collecting-a-support-bundle-deletes-tmp-directory branch May 29, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants