k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Additional log files left in /tmp

Open eht16 opened this issue 1 year ago • 1 comments




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

eht16 avatar May 20 '24 11:05 eht16

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).

VlasovArtem avatar Jun 08 '24 12:06 VlasovArtem