summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-26 12:33:13 -0500
committerJeff Carr <[email protected]>2024-10-26 12:33:13 -0500
commita4e6d7a58b90e80f45c0464afcc507635c3a4375 (patch)
tree50f3289ea1e8087845d02b56d2721d4bd9762947 /config.go
parentef32a06292873c4e8942cef07837a948ff71fa5a (diff)
start cleaning junk fields from config files
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'config.go')
-rw-r--r--config.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/config.go b/config.go
index 01a397d..024d348 100644
--- a/config.go
+++ b/config.go
@@ -76,6 +76,9 @@ func (c *Cluster) ConfigLoadOld() error {
return errors.New("It's not safe to run ConfigLoad() on a nil cluster")
}
+ // erase or zero fields that shouldn't ever be written to the config file
+ c.BlankFields()
+
// load the cluster config file
if data, err := loadFile("virtigo.json"); err == nil {
if err = protojson.Unmarshal(data, c); err != nil {
@@ -134,6 +137,7 @@ func (c *Cluster) ConfigLoad() error {
return err
}
// copy them over. is this needed? does the memory free otherwise?
+ // also set initial values
for _, drop := range d.Droplets {
c.Droplets = append(c.Droplets, drop)
}