Skip to content

Commit 16740e2

Browse files
committed
BUG/MINOR: cluster_sync: properly store storage dirs to file
1 parent ccf05bb commit 16740e2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

configuration/cluster_sync.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ func (c *ClusterSync) monitorBootstrapKey() {
248248
}
249249
c.cfg.Cluster.Name.Store(data["name"])
250250
c.cfg.Cluster.Description.Store(data["description"])
251+
c.cfg.Cluster.StorageDir.Store(data["storage-dir"])
252+
c.cfg.Cluster.ClusterID.Store(data["cluster-id"])
253+
c.cfg.HAProxy.ClusterTLSCertDir = path.Join(data["storage-dir"], "certs-cluster")
254+
c.cfg.Cluster.CertificateDir.Store(path.Join(data["storage-dir"], "certs-cluster"))
251255
c.cfg.Mode.Store(ModeCluster)
252256
err = c.cfg.Save()
253257
if err != nil {

configuration/misc.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ func CheckIfStorageDirIsOK(storageDir string, config *Configuration) error {
118118
return errStorage
119119
}
120120
}
121-
config.Cluster.StorageDir.Store(storageDir)
122-
config.HAProxy.ClusterTLSCertDir = path.Join(storageDir, "certs-cluster")
123-
config.Cluster.CertificateDir.Store(path.Join(storageDir, "certs-cluster"))
124121
return nil
125122
}
126123

0 commit comments

Comments
 (0)