Open suhlig opened 7 months ago
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.
StatefulSet
concourse-work-dir
workDir
rm -rf
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.
The directory behind {{ .Values.concourse.worker.workDir }} should be empty after the init container finished.
{{ .Values.concourse.worker.workDir }}
The fix is to move the asterisk outside the quotes. I'll open a separate PR for this.
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 theconcourse-work-dir
on start. TheworkDir
argument torm -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:
Ok, now let's remove the files using a similar
rm -rf
statement, including the asterisk within the quotes:All files are still there! Let's move the asterisk outside the quotes and try again:
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.