mirror of
https://github.com/containers/podman.git
synced 2025-11-30 01:58:46 +08:00
25 lines
714 B
Go
25 lines
714 B
Go
package common
|
|
|
|
import (
|
|
"os"
|
|
|
|
"go.podman.io/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
|
|
}
|
|
}
|