summaryrefslogtreecommitdiff
path: root/add.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-31 13:38:58 -0500
committerJeff Carr <[email protected]>2024-10-31 13:38:58 -0500
commit284e9161de174602d23c80c085e414ff4f0ee771 (patch)
treeccc6c898d7caee6d9123da9ab21a9cc387f7aac5 /add.go
parent9ad173a845216488a397d5b9d8f7bc15a64c96cb (diff)
maybe works againv0.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'add.go')
-rw-r--r--add.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/add.go b/add.go
index 1bfb480..e644fed 100644
--- a/add.go
+++ b/add.go
@@ -77,7 +77,15 @@ func (c *NewCluster) AddHypervisor(hostname string, cpus int, mem int) *Hypervis
return h
}
-func (c *NewCluster) AddDroplet(uuid string, hostname string, cpus int, mem int) *Droplet {
+func (c *NewCluster) AddEvent(e *Event) {
+ c.e.Events = append(c.e.Events, e)
+}
+
+func (c *NewCluster) AddDroplet(d *Droplet) {
+ c.d.Droplets = append(c.d.Droplets, d)
+}
+
+func (c *NewCluster) AddDropletSimple(uuid string, hostname string, cpus int, mem int) *Droplet {
d := c.FindDropletByName(hostname)
if d != nil {
return d
@@ -93,7 +101,7 @@ func (c *NewCluster) AddDroplet(uuid string, hostname string, cpus int, mem int)
d.Cpus = 1
}
d.Memory = SetGB(mem * 32)
- c.d.Droplets = append(c.d.Droplets, d)
+ c.AddDroplet(d)
return d
}