-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shell completion: respect CONTAINERS_REGISTRIES_CONF
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 <[email protected]>
- Loading branch information
Showing
5 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters