From 19ddeda614fd391d8796102633d13f6ccff9703b 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 6f46660b90..e284bd3b06 100644 --- a/pkg/hostman/storageman/imagecache_local.go +++ b/pkg/hostman/storageman/imagecache_local.go @@ -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) } diff --git a/pkg/hostman/storageman/storage_agent.go b/pkg/hostman/storageman/storage_agent.go index dde0dff97d..00a66b1e7f 100644 --- a/pkg/hostman/storageman/storage_agent.go +++ b/pkg/hostman/storageman/storage_agent.go @@ -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) } diff --git a/pkg/hostman/storageman/storage_local.go b/pkg/hostman/storageman/storage_local.go index 3317701b69..221c1e3797 100644 --- a/pkg/hostman/storageman/storage_local.go +++ b/pkg/hostman/storageman/storage_local.go @@ -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) } diff --git a/pkg/hostman/storageman/storage_rbd.go b/pkg/hostman/storageman/storage_rbd.go index ab80405bdf..1b36ff20ef 100644 --- a/pkg/hostman/storageman/storage_rbd.go +++ b/pkg/hostman/storageman/storage_rbd.go @@ -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) }