fix(hostman): update storagecacheimage status from 'ready' to 'avtive'

This commit is contained in:
rainzm
2021-12-10 15:28:48 +08:00
parent 3499630fb5
commit 19ddeda614
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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)
}
+1 -1
View File
@@ -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)
}
+1 -1
View File
@@ -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)
}
+1 -1
View File
@@ -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)
}