Skip to content

Commit

Permalink
fix(installer): skip docker login when no username
Browse files Browse the repository at this point in the history
Signed-off-by: Tengfei Wang <[email protected]>
  • Loading branch information
davidwtf authored and tke-robot committed Sep 21, 2020
1 parent 2863056 commit 515bcc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/tke-installer/app/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ func (t *TKE) validateConfig(config types.Config) *apierrors.StatusError {
return apierrors.NewBadRequest("tke registry or third party registry required")
}

if config.Registry.ThirdPartyRegistry != nil {
if config.Registry.ThirdPartyRegistry != nil && config.Registry.ThirdPartyRegistry.Username != "" {
cmd := exec.Command("docker", "login",
"--username", config.Registry.ThirdPartyRegistry.Username,
"--password", string(config.Registry.ThirdPartyRegistry.Password),
Expand Down
4 changes: 2 additions & 2 deletions cmd/tke-installer/app/installer/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ type TKERegistry struct {
type ThirdPartyRegistry struct {
Domain string `json:"domain" validate:"required"`
Namespace string `json:"namespace" validate:"required"`
Username string `json:"username" validate:"required"`
Password []byte `json:"password" validate:"required"`
Username string `json:"username"`
Password []byte `json:"password"`
}

type Business struct {
Expand Down

0 comments on commit 515bcc6

Please sign in to comment.