Track Job Pods completion in status

Through Job.status.uncountedPodUIDs and a Pod finalizer

An annotation marks if a job should be tracked with new behavior

A separate work queue is used to remove finalizers from orphan pods.

Change-Id: I1862e930257a9d1f7f1b2b0a526ed15bc8c248ad
This commit is contained in:
Aldo Culquicondor
2021-01-19 17:04:39 -05:00
parent b765496650
commit 2dd2622188
10 changed files with 2548 additions and 714 deletions

View File

@@ -529,15 +529,13 @@ func GetKey(obj interface{}, t *testing.T) string {
}
val := reflect.ValueOf(obj).Elem()
name := val.FieldByName("Name").String()
kind := val.FieldByName("Kind").String()
// Note kind is not always set in the tests, so ignoring that for now
if len(name) == 0 || len(kind) == 0 {
if len(name) == 0 {
t.Errorf("Unexpected object %v", obj)
}
key, err := keyFunc(obj)
if err != nil {
t.Errorf("Unexpected error getting key for %v %v: %v", kind, name, err)
t.Errorf("Unexpected error getting key for %T %v: %v", val.Interface(), name, err)
return ""
}
return key