2020-07-10 05:01:10 -04:00
|
|
|
package driver
|
|
|
|
|
|
|
|
import "github.com/vmware/govmomi/object"
|
|
|
|
|
|
|
|
type Cluster struct {
|
2020-08-31 04:34:41 -04:00
|
|
|
driver *VCenterDriver
|
2020-07-10 05:01:10 -04:00
|
|
|
cluster *object.ClusterComputeResource
|
|
|
|
}
|
|
|
|
|
2020-08-31 04:34:41 -04:00
|
|
|
func (d *VCenterDriver) FindCluster(name string) (*Cluster, error) {
|
2020-07-10 05:01:10 -04:00
|
|
|
c, err := d.finder.ClusterComputeResource(d.ctx, name)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &Cluster{
|
|
|
|
cluster: c,
|
|
|
|
driver: d,
|
|
|
|
}, nil
|
|
|
|
}
|