mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-01 05:07:50 +00:00
Found in debian testing where by default there are no unqualified search registries installed. As such the test failed as the FIXME said. Now there is no need for the test to assume anything. Instead set our own config via CONTAINERS_REGISTRIES_CONF then we can do exact matches, except that env was not read in the shell completion code so move some code around to make it read the var in the same way as podman login/logout. Signed-off-by: Paul Holzinger <git@holzinger.dev>
24 lines
723 B
Go
24 lines
723 B
Go
package common
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/containers/image/v5/types"
|
|
)
|
|
|
|
// SetRegistriesConfPath sets the registries.conf path for the specified context.
|
|
// NOTE: this is a verbatim copy from c/common/libimage which we're not using
|
|
// to prevent leaking c/storage into this file. Maybe this should go into c/image?
|
|
func SetRegistriesConfPath(systemContext *types.SystemContext) {
|
|
if systemContext.SystemRegistriesConfPath != "" {
|
|
return
|
|
}
|
|
if envOverride, ok := os.LookupEnv("CONTAINERS_REGISTRIES_CONF"); ok {
|
|
systemContext.SystemRegistriesConfPath = envOverride
|
|
return
|
|
}
|
|
if envOverride, ok := os.LookupEnv("REGISTRIES_CONFIG_PATH"); ok {
|
|
systemContext.SystemRegistriesConfPath = envOverride
|
|
return
|
|
}
|
|
}
|