mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-03 13:15:17 +08:00
fix: Fix http image registry edit exception (#9460)
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after 2s
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after 2s
This commit is contained in:
parent
8ec5a5bd4b
commit
0d548c7df9
1 changed files with 5 additions and 3 deletions
|
@ -155,10 +155,12 @@ func (u *ImageRepoService) Update(req dto.ImageRepoUpdate) error {
|
|||
needRestart = true
|
||||
}
|
||||
if repo.Protocol == "http" && req.Protocol == "http" {
|
||||
if err := u.handleRegistries(req.DownloadUrl, repo.DownloadUrl, "update"); err != nil {
|
||||
return fmt.Errorf("update registry %s => %s failed, err: %v", repo.DownloadUrl, req.DownloadUrl, err)
|
||||
if repo.DownloadUrl != req.DownloadUrl {
|
||||
if err := u.handleRegistries(req.DownloadUrl, repo.DownloadUrl, "update"); err != nil {
|
||||
return fmt.Errorf("update registry %s => %s failed, err: %v", repo.DownloadUrl, req.DownloadUrl, err)
|
||||
}
|
||||
needRestart = true
|
||||
}
|
||||
needRestart = repo.DownloadUrl == req.DownloadUrl
|
||||
}
|
||||
if repo.Protocol == "https" && req.Protocol == "http" {
|
||||
if err := u.handleRegistries(req.DownloadUrl, "", "create"); err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue