File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,19 @@ func buildMysqlConf(c *mysqlcluster.MysqlCluster) (string, error) {
9595 if len (c .Spec .TlsSecretName ) != 0 {
9696 addKVConfigsToSection (sec , mysqlSSLConfigs )
9797 }
98+ keys := []string {}
99+ for k := range c .Spec .MysqlOpts .MysqlConf {
100+ keys = append (keys , k )
101+ }
102+ sort .Strings (keys )
98103
99- for k , v := range c . Spec . MysqlOpts . MysqlConf {
104+ for _ , k := range keys {
100105 if sec .HasKey (k ) {
101- sec .Key (k ).SetValue (v )
106+ sec .Key (k ).SetValue (c . Spec . MysqlOpts . MysqlConf [ k ] )
102107 } else { // Not in sec.
103108 if _ , ok := pluginConfigs [k ]; ! ok { // Not in pluginconfig.
104109 // Add it to sec
105- if _ , err := sec .NewKey (k , v ); err != nil {
110+ if _ , err := sec .NewKey (k , c . Spec . MysqlOpts . MysqlConf [ k ] ); err != nil {
106111 return "" , fmt .Errorf ("failed to add key to config section: %s" , err )
107112 }
108113 }
You can’t perform that action at this time.
0 commit comments