Until version v3.2, `podman login` trimmed http{s} prefixes along with
everything else but the host[:port] parts. Starting with v3.3, `login`
supports storing credentials for namespaces and dropped support for
trimming prefixes due to ambiguities in registry URLs.
The aforementioned changes caused a regression (see BZ below) as some
users depend on the prefix trimming. Fix that regression by enabling
the http{s} prefix trimming. If present, everything but the host[:port]
parts will be stripped as well.
* `login quay.io/repo` uses `quay.io/repo`
* `login https://quay.io/repo` uses `quay.io`
Fixes: bugzilla.redhat.com/show_bug.cgi?id=2062072
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
... and instead primarily use the string key. This allows
using a docker.io/vendor namespace.
Also rename parseRegistryArgument to parseCredentialsKey,
the argument is not just a registry.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
We now add a new configuration option to opt-in for path based registry
authentication in containers-auth.json. This affects login and logout,
which means if the option is enabled we can now use
`my-registry.local/path/to/image` to save or remove the credentials from
the auth.json.
If the option is enabled, then we enforce a stricter validation of the
input. For example it is not allowed input `http[s]://` prefixed keys.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
DOCKER_CONFIG environment variable is sometimes used to point
to the config.json. The container engines use REGISTRY_AUTH_FILE
for similar functionality. This PR causes programs that use
GetAuthFile to use DOCKER_CONFIG if it set and REGISTRY_AUTH_FILE
is not.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>