From 6aaa57dbe6002b1b0dedfb26d09831e7c9215363 Mon Sep 17 00:00:00 2001 From: rainzm Date: Fri, 10 Dec 2021 15:28:48 +0800 Subject: [PATCH] fix(hostman): update storagecacheimage status from 'ready' to 'avtive' --- pkg/hostman/storageman/imagecache_local.go | 2 +- pkg/hostman/storageman/storage_agent.go | 2 +- pkg/hostman/storageman/storage_local.go | 2 +- pkg/hostman/storageman/storage_rbd.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/hostman/storageman/imagecache_local.go b/pkg/hostman/storageman/imagecache_local.go index 89f9535b45..657e6983a1 100644 --- a/pkg/hostman/storageman/imagecache_local.go +++ b/pkg/hostman/storageman/imagecache_local.go @@ -196,7 +196,7 @@ func (l *SLocalImageCache) fetch(ctx context.Context, zone, srcUrl, format strin l.remoteFile.Fetch() { 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) } diff --git a/pkg/hostman/storageman/storage_agent.go b/pkg/hostman/storageman/storage_agent.go index 2e07eea668..7eb737140c 100644 --- a/pkg/hostman/storageman/storage_agent.go +++ b/pkg/hostman/storageman/storage_agent.go @@ -504,7 +504,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) } diff --git a/pkg/hostman/storageman/storage_local.go b/pkg/hostman/storageman/storage_local.go index e12fd0aea2..cef0b350c1 100644 --- a/pkg/hostman/storageman/storage_local.go +++ b/pkg/hostman/storageman/storage_local.go @@ -286,7 +286,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) } diff --git a/pkg/hostman/storageman/storage_rbd.go b/pkg/hostman/storageman/storage_rbd.go index 48bcc07948..ea0219c06d 100644 --- a/pkg/hostman/storageman/storage_rbd.go +++ b/pkg/hostman/storageman/storage_rbd.go @@ -720,7 +720,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) }