Closed sttcns closed 1 month ago
Hey @sttcns, apologies for the confusion -- I see that the readme has an incorrect value for this field, which includes an environment variable that will never be expanded.
Question for team discussion: should Syft/Grype/et.al. be able to expand environment variables in strings?
This is somewhat related to https://github.com/anchore/grype/issues/2024.
Hi @sttcns we updated the README to fix that example. Sorry for the confusion!
We plan to continue the discussion of #2024, a closely related issue, at an upcoming community gardening.
What happened:
Running Grype with the default configuration fails to expand the
$XDG_CACHE_HOME
environment variable. Instead, it creates the directory with the literal name$XDG_CACHE_HOME
.What you expected to happen:
Grype expands the variable in the configuration file.
How to reproduce it (as minimally and precisely as possible):
Update Grype database
Notice that the database was created/updated in the right place
Create the default configuration copied from the readme of this project
Create the database again.
notice that grype created a new directory with the literal name $XDG_CACHE_HOME instead of expanding the environment variable
Anything else we need to know?:
Interestingly, without the configuration file Grype works fine, as shown above. The issue may lie in the documentation or in the implementation. The docs should say that the environment variables are not expanded in the configuration and that absolute paths should be used. Otherwise, Grype should expand the environment variables.
Environment:
Arch Linux with the lastest Grype.