mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +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)
|
||||
return nil, errors.New("Failed to parse vmDiskPath")
|
||||
}
|
||||
finder := getFinder(dc)
|
||||
ds, err := finder.Datastore(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
|
||||
|
||||
return dc.GetDatastoreByName(ctx, datastorePathObj.Datastore)
|
||||
}
|
||||
|
||||
// GetDatastoreByName gets the Datastore object for the given datastore name
|
||||
|
Loading…
Reference in New Issue
Block a user