mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
[cloudprovider]should reuse code rather than rewrite it
This commit is contained in:
parent
02a7c12cbd
commit
386258b07a
@ -138,14 +138,8 @@ func (dc *Datacenter) GetDatastoreByPath(ctx context.Context, vmDiskPath string)
|
|||||||
glog.Errorf("Failed to parse vmDiskPath: %s", vmDiskPath)
|
glog.Errorf("Failed to parse vmDiskPath: %s", vmDiskPath)
|
||||||
return nil, errors.New("Failed to parse vmDiskPath")
|
return nil, errors.New("Failed to parse vmDiskPath")
|
||||||
}
|
}
|
||||||
finder := getFinder(dc)
|
|
||||||
ds, err := finder.Datastore(ctx, datastorePathObj.Datastore)
|
return dc.GetDatastoreByName(ctx, datastorePathObj.Datastore)
|
||||||
if err != nil {
|
|
||||||
glog.Errorf("Failed while searching for datastore: %s. err: %+v", datastorePathObj.Datastore, err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
datastore := Datastore{ds, dc}
|
|
||||||
return &datastore, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDatastoreByName gets the Datastore object for the given datastore name
|
// GetDatastoreByName gets the Datastore object for the given datastore name
|
||||||
|
Loading…
Reference in New Issue
Block a user