summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-06 05:24:25 -0600
committerJeff Carr <[email protected]>2024-11-06 05:24:25 -0600
commit9e34b3d3f4f1d6593c088ee058aaa055da433988 (patch)
treeece0d3c3cae71187bd074d8c6257ff6e18947bc2
parent15efe46bc4f99975bab107c5387b8c8a70e0020a (diff)
still runs
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--cloud.go12
1 files changed, 12 insertions, 0 deletions
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
}