diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-25 08:20:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-25 08:20:38 -0400 |
commit | b4767817012a3aedaf05dc7a32bd823fcd3776f4 (patch) | |
tree | 2fa1c72aaecad072f3ea4b3283fed20e245c071e /pkg/api/handlers | |
parent | 2d191968b513d327e39376bf8fadd2b4267d15a2 (diff) | |
parent | f95b0995e521e252af52edaf57a31241d364e3d8 (diff) | |
download | podman-b4767817012a3aedaf05dc7a32bd823fcd3776f4.tar.gz podman-b4767817012a3aedaf05dc7a32bd823fcd3776f4.tar.bz2 podman-b4767817012a3aedaf05dc7a32bd823fcd3776f4.zip |
Merge pull request #10774 from vrothberg/registries
remove `pkg/registries`
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r-- | pkg/api/handlers/compat/auth.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/pkg/api/handlers/compat/auth.go b/pkg/api/handlers/compat/auth.go index 2c152fbc2..3594c9781 100644 --- a/pkg/api/handlers/compat/auth.go +++ b/pkg/api/handlers/compat/auth.go @@ -9,9 +9,9 @@ import ( DockerClient "github.com/containers/image/v5/docker" "github.com/containers/image/v5/types" + "github.com/containers/podman/v3/libpod" "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/containers/podman/v3/pkg/registries" docker "github.com/docker/docker/api/types" "github.com/pkg/errors" ) @@ -37,15 +37,13 @@ func Auth(w http.ResponseWriter, r *http.Request) { skipTLS = types.NewOptionalBool(true) } + runtime := r.Context().Value("runtime").(*libpod.Runtime) + sysCtx := runtime.SystemContext() + sysCtx.DockerInsecureSkipTLSVerify = skipTLS + fmt.Println("Authenticating with existing credentials...") - sysCtx := types.SystemContext{ - AuthFilePath: "", - DockerCertPath: "", - DockerInsecureSkipTLSVerify: skipTLS, - SystemRegistriesConfPath: registries.SystemRegistriesConfPath(), - } registry := stripAddressOfScheme(authConfig.ServerAddress) - if err := DockerClient.CheckAuth(context.Background(), &sysCtx, authConfig.Username, authConfig.Password, registry); err == nil { + if err := DockerClient.CheckAuth(context.Background(), sysCtx, authConfig.Username, authConfig.Password, registry); err == nil { utils.WriteResponse(w, http.StatusOK, entities.AuthReport{ IdentityToken: "", Status: "Login Succeeded", |