fix(registries): update password only when not empty (#4669)

pull/4733/head
Chaim Lev-Ari 4 years ago committed by GitHub
parent f3c537ac2c
commit 832cafc933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,7 @@ import (
httperror "github.com/portainer/libhttp/error" httperror "github.com/portainer/libhttp/error"
"github.com/portainer/libhttp/request" "github.com/portainer/libhttp/request"
"github.com/portainer/libhttp/response" "github.com/portainer/libhttp/response"
"github.com/portainer/portainer/api" portainer "github.com/portainer/portainer/api"
bolterrors "github.com/portainer/portainer/api/bolt/errors" bolterrors "github.com/portainer/portainer/api/bolt/errors"
) )
@ -71,7 +71,7 @@ func (handler *Handler) registryUpdate(w http.ResponseWriter, r *http.Request) *
registry.Username = *payload.Username registry.Username = *payload.Username
} }
if payload.Password != nil { if payload.Password != nil && *payload.Password != "" {
registry.Password = *payload.Password registry.Password = *payload.Password
} }

Loading…
Cancel
Save