File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
pkg/controller/clustercontroller Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,24 @@ func (c *Controller) registerClusterInBackupCron(cluster *api.MysqlCluster) erro
7272 j , ok := entry .Job .(job )
7373 if ok && j .Name == cluster .Name && j .Namespace == cluster .Namespace {
7474 glog .V (3 ).Infof ("Cluster %s already added to cron." , cluster .Name )
75+
76+ // change scheduler for already added crons
7577 if ! reflect .DeepEqual (entry .Schedule , schedule ) {
7678 glog .Infof ("Update cluster '%s' scheduler to: %s" ,
7779 cluster .Name , cluster .Spec .BackupSchedule )
7880 c .cron .Remove (cluster .Name )
7981 break
8082 }
83+
84+ // update backups limit for already added crons
85+ if ! reflect .DeepEqual (cluster .Spec .BackupScheduleJobsHistoryLimit , j .BackupScheduleJobsHistoryLimit ) {
86+ glog .Infof ("Update cluster '%s' backup limit to: %v" ,
87+ cluster .Name , cluster .Spec .BackupScheduleJobsHistoryLimit )
88+ c .cron .Remove (cluster .Name )
89+ break
90+ }
91+
92+ // nothing to change for this cluster, return
8193 return nil
8294 }
8395 }
You can’t perform that action at this time.
0 commit comments