-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
bug(gobinary): Trivy fails when ldflags contain nested flags #8365
Comments
I ran
Where did you see
I think this error occurs because |
Settings from Same as in build script - https://github.com/k3s-io/k3s/blob/34ae4da57ec4c81d1e62414a2c2fcb457498b3d5/scripts/build#L64
IIUC we can't disable help for
We check only It seems that |
Wasn't sure where to add this feedback. Not trying to spam but I added it to the original bug as well. @knqyf263 @DmitriyLewen Current execution logs: [2025-02-13T14:30:56Z] [INFO] [Trivy] Scanning namespace: cattle-fleet-clusters-system [2025-02-13T14:31:01Z] [INFO] [Trivy] Scanning namespace: cattle-fleet-local-system [2025-02-13T14:31:16Z] [INFO] [Trivy] Scanning namespace: cattle-fleet-system [2025-02-13T14:31:32Z] [INFO] [Trivy] Scanning namespace: cattle-global-data [2025-02-13T14:31:38Z] [INFO] [Trivy] Scanning namespace: cattle-global-nt [2025-02-13T14:31:42Z] [INFO] [Trivy] Scanning namespace: cattle-impersonation-system [2025-02-13T14:31:47Z] [INFO] [Trivy] Scanning namespace: cattle-provisioning-capi-system [2025-02-13T14:31:56Z] [INFO] [Trivy] Scanning namespace: cattle-system k exec -it trivy-scanner -n security-scanners -- sh trivy --version |
Description
There are flags that use nested flags (e.g. -extldflags '-static -lm -ldl -lz -lpthread').
We trim flags with spaces:
trivy/pkg/dependency/parser/golang/binary/parse.go
Line 148 in bcdc0bb
So we try to parse flags that contain
'
(e.g. ` '-static) and see error:Solution
We only need-X
flags at this time. So I suggest just trimming'
before splitting the flagsWe need to save nested flags as one element of slice. This element must include
'
.e.g.:
Discussed in #8363
The text was updated successfully, but these errors were encountered: