mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix invalid memory address or nil pointer error
This commit is contained in:
@@ -378,7 +378,7 @@ func (self *SStoragecache) StartImageUncacheTask(ctx context.Context, userCred m
|
||||
func (self *SStoragecache) GetIStorageCache() (cloudprovider.ICloudStoragecache, error) {
|
||||
storages := self.getValidStorages()
|
||||
if len(storages) == 0 {
|
||||
msg := "no storages for this storagecache???"
|
||||
msg := fmt.Sprintf("no storages for this storagecache %s(%s)???", self.Name, self.Id)
|
||||
log.Errorf(msg)
|
||||
return nil, fmt.Errorf(msg)
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ func (self *SStoragecache) uploadImage(ctx context.Context, userCred mcclient.To
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
img.storageCache = self
|
||||
err = cloudprovider.WaitStatus(img, api.CACHED_IMAGE_STATUS_READY, time.Second*5, time.Minute*10) //windows镜像转换比较慢,等待时间稍微设长一些
|
||||
if err != nil {
|
||||
log.Errorf("waitting for image %s(%s) status ready timeout", img.Name, img.UUID)
|
||||
|
||||
Reference in New Issue
Block a user