Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: create the compatibility -imp symlinks only once #126

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

kdudka
Copy link
Member

@kdudka kdudka commented Sep 27, 2023

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

@kdudka kdudka self-assigned this Sep 27, 2023
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
Closes: csutils#126
... for compatibility.  It was omitted by mistake.

Reported-by: Florencio Cano Gabarda
Related: csutils#126
Copy link
Collaborator

@jperezdealgaba jperezdealgaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This /lgtm

@jperezdealgaba
Copy link
Collaborator

Approved

@kdudka
Copy link
Member Author

kdudka commented Sep 29, 2023

@jperezdealgaba Thanks for review!

@kdudka kdudka closed this in bd90061 Sep 29, 2023
@kdudka kdudka merged commit 0ee6c67 into csutils:main Sep 29, 2023
29 checks passed
kdudka added a commit to kdudka/openscanhub that referenced this pull request Nov 16, 2023
... such that they really point to all defects and not
to the compatibility symlinks to important defects only.

This fixes a user experience issue introduced by the following
change in csmock:
csutils/csmock#126
kdudka added a commit to kdudka/openscanhub that referenced this pull request Nov 16, 2023
... such that they really point to all defects and not
to the compatibility symlinks to important defects only.

This fixes a user experience issue introduced by the following
change in csmock:
csutils/csmock#126

Closes: openscanhub#186
kdudka added a commit to kdudka/openscanhub that referenced this pull request Nov 27, 2023
... such that they really point to all defects and not
to the compatibility symlinks to important defects only.

This fixes a user experience issue introduced by the following
change in csmock:
csutils/csmock#126

Closes: openscanhub#186
@kdudka kdudka deleted the dup-symlinks branch September 19, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants