derailed / popeye

👀 A Kubernetes cluster resource sanitizer
https://popeyecli.io
Other
5.21k stars 282 forks source link

Path of the results file changed from v0.11 to v0.20 #316

Closed johnqa closed 6 days ago

johnqa commented 2 months ago




Describe the bug I am running popeye with docker and I noticed that the same command using image v0.11.3 and v0.20.0 put the report file in different locations: /tmp/popeye/report_file.html for v0.11.3 and /tmp/popeye///my_report.txt for v0.20.0 and after (including v.0.21.3).

Setting a POPEYE_REPORT_DIR only replaces /tmp/popeye with the path from env variable.

To Reproduce Steps to reproduce the behavior:

  1. Run docker command with both versions:
    docker run --rm -v $(pwd)/config:/home/nonroot/.kube/config -v /tmp:/tmp \
    derailed/popeye:v0.21.3  -n bar --save --output-file my_report.txt
    --result--
    /tmp/popeye/<cluster_name or user>/<cluster_name or user>/my_report.txt
docker run --rm -v $(pwd)/config:/home/nonroot/.kube/config -v /tmp:/tmp \
  derailed/popeye:v0.11.3  -n bar --save --output-file my_report.txt
--result--
/tmp/popeye/my_report.txt

Expected behavior Is there a way to have a fixed path that I can set with POPEYE_REPORT_DIR and nothing extra to be added?

derailed commented 6 days ago

@johnqa Thank you for this issue!

You are correct. Since users may target different clusters and hence we want to dump the reports in cluster specific location. That said we can relax this a bit and assume if the user overrides the default report location then this should be the final report resting place with no alterations. I'll update the code to change the behavior ie if you set POPEYE_REPORT_DIR env var then the reports will land there. Watch for this in the next drop.