clean nginx temp configs function does not work #11568
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/frozen
Indicates that an issue or PR should not be auto-closed due to staleness.
needs-priority
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened:
The
testTemplate
function creates a temp config(os.CreateTemp(tmpDir, tempNginxPattern)
) in thetempDir/nginx
directory (tmpDir := os.TempDir() + "/nginx"
) but thecleanTempNginxCfg
function cleans only the tmp directory. This means that this function does not work, and wrong nginx temp configs are not deleted, and it leads to clogging up FS. And there is a wrong test, because the test creates files in the temp dir, and that is why it passes now.Mistake is this function:
Due to this condition the function checks only the temp dir and does not check nested
tempDir/nginx
What you expected to happen:
Wrong nginx temp configs are deleted.
How to reproduce this issue:
Create nginx temp configs(files whose name begins with prefix
nginx-cfg
) intempDir/nginx
and wait 6 minutes, nothing will happen.The text was updated successfully, but these errors were encountered: