summaryrefslogtreecommitdiff
path: root/create.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-30 19:38:12 -0500
committerJeff Carr <[email protected]>2024-10-30 19:38:12 -0500
commit41673f31706a4c68a26d580e42983380a0f15934 (patch)
treec620c31ad8c6e76933aa18b0ba78e7fb2ece6afa /create.go
parenteacf3b8bef9801126c5693660acc2d03e3664025 (diff)
reject start and create early if grid unstable
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'create.go')
-rw-r--r--create.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/create.go b/create.go
index ab36093..60bf128 100644
--- a/create.go
+++ b/create.go
@@ -42,6 +42,15 @@ func create(w http.ResponseWriter, r *http.Request) (string, error) {
log.Info("Got msg:", string(msg))
log.Info("hostname =", d.Hostname)
name := d.Hostname
+
+ // don't continue past here if the grid is unstable anyway
+ // because this will add the droplet to cluster.Droplets
+ if s, err := isClusterStable(); err != nil {
+ log.Info(s)
+ fmt.Fprintln(w, s)
+ return s, err
+ }
+
tmpd := findDroplet(name)
if tmpd != nil {
result := "create error: Droplet " + name + " is already defined"