mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-23 10:32:03 +00:00
Added syncjob
This commit is contained in:
parent
f87cc43cdb
commit
ff1659cb79
@ -5190,7 +5190,7 @@ func TestBackupFinalizerRemoval(t *testing.T) {
|
|||||||
// This is done above by initializing the manager and not calling manager.Run() yet.
|
// This is done above by initializing the manager and not calling manager.Run() yet.
|
||||||
|
|
||||||
// 2. Create a job.
|
// 2. Create a job.
|
||||||
job := newJob(2, 2, 6, batch.NonIndexedCompletion)
|
job := newJob(1, 1, 1, batch.NonIndexedCompletion)
|
||||||
|
|
||||||
// 3. Create the pods.
|
// 3. Create the pods.
|
||||||
podBuilder := buildPod().name("test_pod").deletionTimestamp().trackingFinalizer().job(job)
|
podBuilder := buildPod().name("test_pod").deletionTimestamp().trackingFinalizer().job(job)
|
||||||
@ -5208,6 +5208,11 @@ func TestBackupFinalizerRemoval(t *testing.T) {
|
|||||||
// 5. Start the workers.
|
// 5. Start the workers.
|
||||||
go manager.Run(context.TODO(), 0)
|
go manager.Run(context.TODO(), 0)
|
||||||
|
|
||||||
|
err = manager.syncJob(context.TODO(), testutil.GetKey(job, t))
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Unexpected error when syncing jobs %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the finalizer has been removed from the pod.
|
// Check if the finalizer has been removed from the pod.
|
||||||
if err := wait.Poll(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
|
if err := wait.Poll(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
|
||||||
p, err := clientset.CoreV1().Pods(pod.Namespace).Get(context.Background(), pod.Name, metav1.GetOptions{})
|
p, err := clientset.CoreV1().Pods(pod.Namespace).Get(context.Background(), pod.Name, metav1.GetOptions{})
|
||||||
|
Loading…
Reference in New Issue
Block a user