k9s
k9s copied to clipboard
Additional log files left in /tmp
Describe the bug
After running k9s a couple of log files are left in /tmp:
-rw-rw-r-- 1 enrico enrico 2.3K Mai 20 12:42 k9s.hostname.enrico.log.ERROR.20240520-123904.122464
-rw-rw-r-- 1 enrico enrico 3.7K Mai 20 12:51 k9s.hostname.enrico.log.ERROR.20240520-124754.123162
-rw-rw-r-- 1 enrico enrico 4.0K Mai 20 12:42 k9s.hostname.enrico.log.INFO.20240520-123904.122464
-rw-rw-r-- 1 enrico enrico 6.5K Mai 20 12:51 k9s.hostname.enrico.log.INFO.20240520-124754.123162
-rw-rw-r-- 1 enrico enrico 4.0K Mai 20 12:42 k9s.hostname.enrico.log.WARNING.20240520-123904.122464
-rw-rw-r-- 1 enrico enrico 6.5K Mai 20 12:51 k9s.hostname.enrico.log.WARNING.20240520-124754.123162
I explicitly set the environment variable K9S_LOGS_DIR=/tmp/k9s and /tmp/k9s/k9s.log is written as expected but the additional log files don't seem to be of much use.
To Reproduce
Not completely sure when it happens. Not only always but often enough that those additionals log files pollute /tmp.
Expected behavior
k9s writes log only to $K9S_LOGS_DIR.
Versions (please complete the following information):
- OS: Linux (Debian Testing)
- K9s: v0.32.4
- K8s: 1.28
The logs that are not in the K9S_LOGS_DIR are related to the klog library. At this point, the implementation does not update the log_file parameter for this library (main.go:15).