mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
fix(hostman): update storagecacheimage status from 'ready' to 'avtive'
This commit is contained in:
@@ -191,7 +191,7 @@ func (l *SLocalImageCache) fetch(ctx context.Context, input api.CacheImageInput,
|
||||
var _fetch = func() error {
|
||||
if len(l.Manager.GetId()) > 0 {
|
||||
_, err := hostutils.RemoteStoragecacheCacheImage(ctx,
|
||||
l.Manager.GetId(), l.imageId, "ready", l.GetPath())
|
||||
l.Manager.GetId(), l.imageId, "active", l.GetPath())
|
||||
if err != nil {
|
||||
log.Errorf("Fail to update host cached image: %s", err)
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ func (as *SAgentStorage) SaveToGlance(ctx context.Context, params interface{}) (
|
||||
}
|
||||
imagecacheManager.LoadImageCache(imageId)
|
||||
_, err := hostutils.RemoteStoragecacheCacheImage(ctx,
|
||||
imagecacheManager.GetId(), imageId, "ready", dstPath)
|
||||
imagecacheManager.GetId(), imageId, "active", dstPath)
|
||||
if err != nil {
|
||||
log.Errorf("Fail to remote cache image: %s", err)
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ func (s *SLocalStorage) SaveToGlance(ctx context.Context, params interface{}) (j
|
||||
}
|
||||
imagecacheManager.LoadImageCache(imageId)
|
||||
_, err := hostutils.RemoteStoragecacheCacheImage(ctx,
|
||||
imagecacheManager.GetId(), imageId, "ready", dstPath)
|
||||
imagecacheManager.GetId(), imageId, "active", dstPath)
|
||||
if err != nil {
|
||||
log.Errorf("Fail to remote cache image: %s", err)
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ func (s *SRbdStorage) SaveToGlance(ctx context.Context, params interface{}) (jso
|
||||
}
|
||||
|
||||
rbdImageCache.LoadImageCache(imageId)
|
||||
_, err := hostutils.RemoteStoragecacheCacheImage(ctx, rbdImageCache.GetId(), imageId, "ready", imagePath)
|
||||
_, err := hostutils.RemoteStoragecacheCacheImage(ctx, rbdImageCache.GetId(), imageId, "active", imagePath)
|
||||
if err != nil {
|
||||
log.Errorf("Fail to remote cache image: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user