diff --git a/cloud.go b/cloud.go index 6f601cf..aea5c19 100644 --- a/cloud.go +++ b/cloud.go @@ -1,5 +1,13 @@ 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 ( "context" "errors" @@ -30,6 +38,7 @@ type cloudAPI interface { } func NewCloud() *CloudManager { + // client := virtbuf.NewRealCloudAPIClient() // clusterManager := NewCloudManager(myClient) newCloudManager := &CloudManager{client: myClient} @@ -45,6 +54,9 @@ func NewCloud() *CloudManager { // FindByName retrieves a cluster by name. func (m *CloudManager) FindDropletByName(name string) (*virtbuf.Droplet, error) { + if m.cluster == nil { + return nil, nil + } d := m.cluster.FindDropletByName(name) return d, nil }