@@ -76,20 +76,22 @@ type APIConfiguration struct {
76
76
}
77
77
78
78
type 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"`
93
95
}
94
96
95
97
func (c * ClusterConfiguration ) Clear () {
@@ -103,6 +105,8 @@ func (c *ClusterConfiguration) Clear() {
103
105
c .CertificateFetched .Store (false )
104
106
c .Name .Store ("" )
105
107
c .Description .Store ("" )
108
+ c .ClusterID .Store ("" )
109
+ c .ClusterLogTargets = nil
106
110
}
107
111
108
112
type RuntimeData struct {
@@ -269,6 +273,10 @@ func (c *Configuration) Save() error {
269
273
cfg := c .storage .Get ()
270
274
cfg .LogTargets = nil
271
275
}
276
+ if len (c .Cluster .ClusterLogTargets ) == 0 {
277
+ cfg := c .storage .Get ()
278
+ cfg .Cluster .ClusterLogTargets = nil
279
+ }
272
280
// clean storage data if we are not in cluster mode or preparing to go into that mode
273
281
if cfg .Mode .Load () != "cluster" && cfg .Cluster .BootstrapKey .Load () == "" {
274
282
storage := cfg .storage .Get ()
0 commit comments