Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common: create the compatibility
-imp
symlinks only once
The code was trying to create them twice by mistake. The second creation failed, so it was harmless but it unnecessarily polluted `scan.log` like this: ``` [...] >>> 2023-09-27 18:12:14 "ln" "-s" "scan-results.err" "/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp.err" >>> 2023-09-27 18:12:14 "ln" "-s" "scan-results.html" "/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp.html" >>> 2023-09-27 18:12:14 "ln" "-s" "scan-results-summary.txt" "/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp-summary.txt" >>> 2023-09-27 18:12:14 "csgrep --mode=grep --invert-match --event \"internal warning\" --prune-events=1 '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/debug/suppress >>> 2023-09-27 18:12:14 "csgrep --mode=json --invert-match --event \"internal warning\" --prune-events=1 '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/debug/suppress >>> 2023-09-27 18:12:14 "csgrep --mode=evtstat --invert-match --event \"internal warning\" --prune-events=1 '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/debug/suppr >>> 2023-09-27 18:12:14 "\"bash\" \"-c\" \"csgrep '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results.js' --mode=json --checker '^(RESOURCE_LEAK)\\\$' | csgre >>> 2023-09-27 18:12:14 "cslinker --implist '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp.js' '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1 renamed '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp.js' -> '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results.js' >>> 2023-09-27 18:12:14 "csgrep --mode=grep --invert-match --event \"internal warning\" --prune-events=1 '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-a >>> 2023-09-27 18:12:14 "csgrep --mode=json --invert-match --event \"internal warning\" --prune-events=1 '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-a >>> 2023-09-27 18:12:14 "csgrep --mode=evtstat --invert-match --event \"internal warning\" --prune-events=1 '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-result 2 SUPPRESSED_ERROR suppressed_error >>> 2023-09-27 18:12:14 "ln" "-s" "scan-results.err" "/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp.err" ln: failed to create symbolic link '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp.err': File exists >>> 2023-09-27 18:12:14 "ln" "-s" "scan-results.html" "/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp.html" ln: failed to create symbolic link '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp.html': File exists >>> 2023-09-27 18:12:14 "ln" "-s" "scan-results-summary.txt" "/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp-summary.txt" ln: failed to create symbolic link '/tmp/cspodmanfx586tbu/prom-label-proxy-container-v4.1.8-201907241243/scan-results-imp-summary.txt': File exists [...] ``` Related: https://issues.redhat.com/browse/OSH-289
- Loading branch information