-
Notifications
You must be signed in to change notification settings - Fork 379
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
Read registries.conf from XDG_CONFIG_HOME if set #2450
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Martin Weber <[email protected]>
The tests have not been adapted yet, so they will fail if If anyone knows how to extend/adapt the tests, contributions welcome. 😅 |
Also set CONTAINERS_REGISTRIES_CONF, as it appears to hardcode ~/.config for XDG_CONFIG_HOME [1] [2]. [1] containers/image#1647 [2] containers/image#2450
I just stumbled over #1011 and the feedback there to use --edit For some reason that makes this one check fail:
For reference, the diff to the current version (where everything passes): diff --git a/pkg/sysregistriesv2/system_registries_v2.go b/pkg/sysregistriesv2/system_registries_v2.go
index 5dbf5e6e..cb0340b6 100644
--- a/pkg/sysregistriesv2/system_registries_v2.go
+++ b/pkg/sysregistriesv2/system_registries_v2.go
@@ -564,10 +564,9 @@ func newConfigWrapper(ctx *types.SystemContext) configWrapper {
// it exists only to allow testing it with an artificial home directory.
func newConfigWrapperWithHomeDir(ctx *types.SystemContext, homeDir string) configWrapper {
var wrapper configWrapper
- var configHome string
- var envVarFound bool
- if configHome, envVarFound = os.LookupEnv("XDG_CONFIG_HOME"); !envVarFound {
+ configHome, err := homedir.GetConfigHome()
+ if err != nil {
configHome = filepath.Join(homeDir, ".config")
}
userRegistriesFilePath := filepath.Join(configHome, userRegistriesFile) I suspects it now fails to handle |
Thanks!
That needs to be handled in the tests; ideally the tests should cover both the case when the variable is set, and when it is not. See how other tests are calling |
@martinwe-adfinis still working on this? |
@rhatdan Not yet, unfortunately. I also cannot give an ETA when I will find some time again to look at the tests or complete the issue pointed out in my comment above. Apologies for the delay. Feel free to have a look at if you want. |
Also set CONTAINERS_REGISTRIES_CONF, as it appears to hardcode ~/.config for XDG_CONFIG_HOME [1] [2]. [1] containers/image#1647 [2] containers/image#2450
Also set CONTAINERS_REGISTRIES_CONF, as it appears to hardcode ~/.config for XDG_CONFIG_HOME [1] [2]. [1] containers/image#1647 [2] containers/image#2450
Also set CONTAINERS_REGISTRIES_CONF, as it appears to hardcode ~/.config for XDG_CONFIG_HOME [1] [2]. [1] containers/image#1647 [2] containers/image#2450
Also set CONTAINERS_REGISTRIES_CONF, as it appears to hardcode ~/.config for XDG_CONFIG_HOME [1] [2]. [1] containers/image#1647 [2] containers/image#2450
Addresses #1647.