Skip to content

Commit 4500196

Browse files
committed
添加仓库时检测是否可以正常登录
1 parent 51a649f commit 4500196

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/common/http/controller/registry.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ func (self Registry) Create(http *gin.Context) {
7676
self.JsonResponseWithError(http, err, 500)
7777
return
7878
}
79+
} else {
80+
response, err = docker.Sdk.Client.RegistryLogin(docker.Sdk.Ctx, registry.AuthConfig{
81+
ServerAddress: params.ServerAddress,
82+
Email: params.Email,
83+
})
84+
if err != nil {
85+
self.JsonResponseWithError(http, err, 500)
86+
return
87+
}
7988
}
8089

8190
registryNew := &entity.Registry{

0 commit comments

Comments
 (0)