summaryrefslogtreecommitdiff
path: root/configfiles.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-22 18:58:47 -0500
committerJeff Carr <[email protected]>2024-10-22 18:58:47 -0500
commite2d872f088be24e0a6355f6826625b129a965698 (patch)
tree66f69afaec1a7e9be2980837b853f8806715ff9c /configfiles.go
parentb1a943fa3dff6a9a0d7f802111334be7d1175492 (diff)
start to deprecate dumb droplets file
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'configfiles.go')
-rw-r--r--configfiles.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/configfiles.go b/configfiles.go
index fbaee5a..cda724d 100644
--- a/configfiles.go
+++ b/configfiles.go
@@ -22,9 +22,22 @@ func readConfigFile() {
}
err = me.cluster.UnmarshalJSON(pfile)
if err != nil {
- log.Info("create json failed", err)
+ log.Info("read json failed", err)
+ os.Exit(-1)
return
}
+ for _, pbd := range me.cluster.Droplets {
+ d := findDroplet(pbd.Hostname)
+ if d != nil {
+ continue
+ }
+ // this is a new unknown droplet (not in the config file)
+ d = new(DropletT)
+ d.pb = pbd
+ me.droplets = append(me.droplets, d)
+ log.Log(EVENT, "config new droplet", d.pb.Hostname, d.pb.StartState, d.pb.PreferredHypervisor)
+ }
+
}
func writeConfigFile() {