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

Worker disks not cleaned up on pod start (incl. solution) #360

Open
suhlig opened this issue May 7, 2024 · 0 comments · May be fixed by #361
Open

Worker disks not cleaned up on pod start (incl. solution) #360

suhlig opened this issue May 7, 2024 · 0 comments · May be fixed by #361
Labels
bug Something isn't working

Comments

@suhlig
Copy link

suhlig commented May 7, 2024

Describe the bug

I believe I found a bug in the chart that would explain why the disks of our workers keep growing and are not emptied out upon worker start.

When deploying the workers as StatefulSet, an init container is created for each worker to clear out the concourse-work-dir on start. The workDir argument to rm -rf is generated with the asterisk in the quotes, which makes it match nothing in bash.

Reproduction steps

This bug can be reproduced even outside Concourse:

$ mkdir -p /tmp/concourse-work-dir
$ touch /tmp/concourse-work-dir/{foo,bar,baz}
$ ls /tmp/concourse-work-dir
bar     baz     foo

Ok, now let's remove the files using a similar rm -rf statement, including the asterisk within the quotes:

$ rm -rf "/tmp/concourse-work-dir/*"
$ echo $?
0
$ ls /tmp/concourse-work-dir
bar     baz     foo

All files are still there! Let's move the asterisk outside the quotes and try again:

$ rm -rf "/tmp/concourse-work-dir/"*
$ ls /tmp/concourse-work-dir

Empty, as desired.

Expected behavior

The directory behind {{ .Values.concourse.worker.workDir }} should be empty after the init container finished.

Additional context

The fix is to move the asterisk outside the quotes. I'll open a separate PR for this.

@suhlig suhlig added the bug Something isn't working label May 7, 2024
@suhlig suhlig linked a pull request May 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant