mirror of
https://github.com/labring/sealos.git
synced 2026-09-01 15:38:06 +08:00
fix: panic when building offline and syntax error in registry config (#1086)
This commit is contained in:
@@ -91,6 +91,7 @@ func buildahRegistrySync() error {
|
||||
|
||||
[[registry]]
|
||||
prefix = "localhost"
|
||||
location = "localhost"
|
||||
|
||||
[[registry.mirror]]
|
||||
location = "docker.io/lameleg"
|
||||
|
||||
@@ -93,10 +93,6 @@ func (is *DefaultImageSaver) SaveImages(images []string, dir string, platform v1
|
||||
tmpnameds := nameds
|
||||
numCh <- struct{}{}
|
||||
eg.Go(func() error {
|
||||
defer func() {
|
||||
<-numCh
|
||||
mu.Unlock()
|
||||
}()
|
||||
auth := is.auths[tmpnameds[0].domain]
|
||||
if auth.ServerAddress == "" {
|
||||
auth.ServerAddress = tmpnameds[0].domain
|
||||
@@ -106,6 +102,11 @@ func (is *DefaultImageSaver) SaveImages(images []string, dir string, platform v1
|
||||
return fmt.Errorf("init registry error: %v", err)
|
||||
}
|
||||
mu.Lock()
|
||||
defer func() {
|
||||
<-numCh
|
||||
mu.Unlock()
|
||||
}()
|
||||
|
||||
err = is.save(tmpnameds, platform, registry)
|
||||
if err != nil {
|
||||
logger.Warn("save domain %s image %s error: %v", tmpnameds[0].domain, tmpnameds[0].FullName(), err)
|
||||
|
||||
Reference in New Issue
Block a user