summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/compat/auth.go14
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",