Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for IsJobSucceeded (0.08 sec)

  1. pkg/controller/job/util/utils.go

    // It does not discriminate between successful and failed terminations.
    func IsJobFinished(j *batch.Job) bool {
    	isFinished, _ := FinishedCondition(j)
    	return isFinished
    }
    
    // IsJobSucceeded returns whether a job has completed successfully.
    func IsJobSucceeded(j *batch.Job) bool {
    	for _, c := range j.Status.Conditions {
    		if c.Type == batch.JobComplete && c.Status == v1.ConditionTrue {
    			return true
    		}
    	}
    	return false
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 07 09:27:46 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  2. pkg/controller/job/util/utils_test.go

    							Status: v1.ConditionFalse,
    						},
    					},
    				},
    			},
    			wantResult: false,
    		},
    	}
    	for name, tc := range tests {
    		t.Run(name, func(t *testing.T) {
    			gotResult := IsJobSucceeded(&tc.job)
    			if tc.wantResult != gotResult {
    				t.Errorf("unexpected result, want=%v, got=%v", tc.wantResult, gotResult)
    			}
    		})
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 07 09:27:46 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  3. pkg/controller/cronjob/cronjob_controllerv2.go

    			deleteFromActiveList(cronJob, j.ObjectMeta.UID)
    			jm.recorder.Eventf(cronJob, corev1.EventTypeNormal, "SawCompletedJob", "Saw completed job: %s, condition: %v", j.Name, condition)
    			updateStatus = true
    		} else if jobutil.IsJobSucceeded(j) {
    			// a job does not have to be in active list, as long as it has completed successfully, we will process the timestamp
    			if cronJob.Status.LastSuccessfulTime == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 09 03:34:25 UTC 2024
    - 29.2K bytes
    - Viewed (0)
Back to top