Merge pull request #36161 from soltysh/fix_replace
Automatic merge from submit-queue Fix how we iterate over active jobs when removing them for Replace policy When fixing the Replace Active removal I used wrong for loop construct which panics :/ This PR fixes that by using for range. @janetkuo ptal @jessfraz this will also be a cherry-pick candidate for 1.4, I remember we've picked the aforementioned fix as well
This commit is contained in:
		@@ -203,8 +203,7 @@ func SyncOne(sj batch.ScheduledJob, js []batch.Job, now time.Time, jc jobControl
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if sj.Spec.ConcurrencyPolicy == batch.ReplaceConcurrent {
 | 
						if sj.Spec.ConcurrencyPolicy == batch.ReplaceConcurrent {
 | 
				
			||||||
		for i := range sj.Status.Active {
 | 
							for _, j := range sj.Status.Active {
 | 
				
			||||||
			j := sj.Status.Active[i]
 | 
					 | 
				
			||||||
			// TODO: this should be replaced with server side job deletion
 | 
								// TODO: this should be replaced with server side job deletion
 | 
				
			||||||
			// currently this mimics JobReaper from pkg/kubectl/stop.go
 | 
								// currently this mimics JobReaper from pkg/kubectl/stop.go
 | 
				
			||||||
			glog.V(4).Infof("Deleting job %s of %s that was still running at next scheduled start time", j.Name, nameForLog)
 | 
								glog.V(4).Infof("Deleting job %s of %s that was still running at next scheduled start time", j.Name, nameForLog)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user