You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trivy includes all flags into config file when using --generate-default-config command.
But Trivy returns error for this config file:
➜ trivy image
2024-12-03T12:44:48-07:00 INFO Loaded file_path="trivy.yaml"
2024-12-03T12:44:48-07:00 ERROR "--reset" was removed. Use "trivy clean --all" instead.
2024-12-03T12:44:48-07:00 FATAL Fatal error flag error: db flag error: unable to parse flag: removed flag ("--reset")
We need to exclude removed and obsolete flags from the generated configuration file.
Although this bug was closed, I am seeing these errors in v0.58.2, and there were other problems with the generation that the original bug reporter didn't encounter, please see my comment in discussion 8035 for details, summary quoted below:
The generated config file should work with the same version of trivy used to generate it.
Also, the configuration generator should at least
Issue a warning that the default ignore file doesn't exist, or
Create the file if it doesn't exist.
Alternately trivy could consider non-existence of a configured ignore file a non-fatal error.
My preference would be for (1) but any of these would be acceptable.
Finally, the generated config file sets the option to generate a config file, which fails (since it now exists).
Description
Trivy includes all flags into config file when using
--generate-default-config
command.But Trivy returns error for this config file:
We need to exclude removed and obsolete flags from the generated configuration file.
Discussed in #8035
The text was updated successfully, but these errors were encountered: