@@ -76,20 +76,22 @@ type APIConfiguration struct {
7676}
7777
7878type ClusterConfiguration struct {
79- ID AtomicString `yaml:"id,omitempty" group:"cluster" save:"true"`
80- BootstrapKey AtomicString `yaml:"bootstrap_key,omitempty" group:"cluster" save:"true"`
81- ActiveBootstrapKey AtomicString `yaml:"active_bootstrap_key,omitempty" group:"cluster" save:"true"`
82- Token AtomicString `yaml:"token,omitempty" group:"cluster" save:"true"`
83- URL AtomicString `yaml:"url,omitempty" group:"cluster" save:"true"`
84- Port AtomicInt `yaml:"port,omitempty" group:"cluster" save:"true"`
85- APIBasePath AtomicString `yaml:"api_base_path,omitempty" group:"cluster" save:"true"`
86- APINodesPath AtomicString `yaml:"api_nodes_path,omitempty" group:"cluster" save:"true"`
87- APIRegisterPath AtomicString `yaml:"api_register_path,omitempty" group:"cluster" save:"true"`
88- StorageDir AtomicString `yaml:"storage_dir,omitempty" group:"cluster" save:"true"`
89- CertificateDir AtomicString `yaml:"cert_path,omitempty" group:"cluster" save:"true"`
90- CertificateFetched AtomicBool `yaml:"cert_fetched,omitempty" group:"cluster" save:"true" example:"false"`
91- Name AtomicString `yaml:"name,omitempty" group:"cluster" save:"true"`
92- Description AtomicString `yaml:"description,omitempty" group:"cluster" save:"true"`
79+ ID AtomicString `yaml:"id,omitempty" group:"cluster" save:"true"`
80+ BootstrapKey AtomicString `yaml:"bootstrap_key,omitempty" group:"cluster" save:"true"`
81+ ActiveBootstrapKey AtomicString `yaml:"active_bootstrap_key,omitempty" group:"cluster" save:"true"`
82+ Token AtomicString `yaml:"token,omitempty" group:"cluster" save:"true"`
83+ URL AtomicString `yaml:"url,omitempty" group:"cluster" save:"true"`
84+ Port AtomicInt `yaml:"port,omitempty" group:"cluster" save:"true"`
85+ APIBasePath AtomicString `yaml:"api_base_path,omitempty" group:"cluster" save:"true"`
86+ APINodesPath AtomicString `yaml:"api_nodes_path,omitempty" group:"cluster" save:"true"`
87+ APIRegisterPath AtomicString `yaml:"api_register_path,omitempty" group:"cluster" save:"true"`
88+ StorageDir AtomicString `yaml:"storage_dir,omitempty" group:"cluster" save:"true"`
89+ CertificateDir AtomicString `yaml:"cert_path,omitempty" group:"cluster" save:"true"`
90+ CertificateFetched AtomicBool `yaml:"cert_fetched,omitempty" group:"cluster" save:"true" example:"false"`
91+ Name AtomicString `yaml:"name,omitempty" group:"cluster" save:"true"`
92+ Description AtomicString `yaml:"description,omitempty" group:"cluster" save:"true"`
93+ ClusterLogTargets []* models.ClusterLogTarget `yaml:"cluster_log_targets,omitempty" group:"cluster" save:"true"`
94+ ClusterID AtomicString `yaml:"cluster_id,omitempty" group:"cluster" save:"true"`
9395}
9496
9597func (c * ClusterConfiguration ) Clear () {
@@ -103,6 +105,8 @@ func (c *ClusterConfiguration) Clear() {
103105 c .CertificateFetched .Store (false )
104106 c .Name .Store ("" )
105107 c .Description .Store ("" )
108+ c .ClusterID .Store ("" )
109+ c .ClusterLogTargets = nil
106110}
107111
108112type RuntimeData struct {
@@ -269,6 +273,10 @@ func (c *Configuration) Save() error {
269273 cfg := c .storage .Get ()
270274 cfg .LogTargets = nil
271275 }
276+ if len (c .Cluster .ClusterLogTargets ) == 0 {
277+ cfg := c .storage .Get ()
278+ cfg .Cluster .ClusterLogTargets = nil
279+ }
272280 // clean storage data if we are not in cluster mode or preparing to go into that mode
273281 if cfg .Mode .Load () != "cluster" && cfg .Cluster .BootstrapKey .Load () == "" {
274282 storage := cfg .storage .Get ()
0 commit comments