still runs

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-06 05:24:25 -06:00
parent 15efe46bc4
commit 9e34b3d3f4
1 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,13 @@
package virtigolib package virtigolib
// makes a Cluster interface which is:
// a number of hypervisors (the physical machines)
// a list of the virtual machines
// functions to start, stop, etc virtual machines
// virtual machines are often called droplets to make it easier to understand
import ( import (
"context" "context"
"errors" "errors"
@ -30,6 +38,7 @@ type cloudAPI interface {
} }
func NewCloud() *CloudManager { func NewCloud() *CloudManager {
// client := virtbuf.NewRealCloudAPIClient()
// clusterManager := NewCloudManager(myClient) // clusterManager := NewCloudManager(myClient)
newCloudManager := &CloudManager{client: myClient} newCloudManager := &CloudManager{client: myClient}
@ -45,6 +54,9 @@ func NewCloud() *CloudManager {
// FindByName retrieves a cluster by name. // FindByName retrieves a cluster by name.
func (m *CloudManager) FindDropletByName(name string) (*virtbuf.Droplet, error) { func (m *CloudManager) FindDropletByName(name string) (*virtbuf.Droplet, error) {
if m.cluster == nil {
return nil, nil
}
d := m.cluster.FindDropletByName(name) d := m.cluster.FindDropletByName(name)
return d, nil return d, nil
} }