mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
Merge pull request #128398 from tenzen-y/remaining-job-tracking-annotation-testing
Job: Remove JobTrackingFinalizer annotation specific testings
This commit is contained in:
commit
38fab70477
@ -988,49 +988,6 @@ func TestJobStrategy_ValidateUpdate(t *testing.T) {
|
|||||||
{Type: field.ErrorTypeInvalid, Field: "spec.completions"},
|
{Type: field.ErrorTypeInvalid, Field: "spec.completions"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"preserving tracking annotation": {
|
|
||||||
job: &batch.Job{
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
|
||||||
Name: "myjob",
|
|
||||||
Namespace: metav1.NamespaceDefault,
|
|
||||||
ResourceVersion: "0",
|
|
||||||
Annotations: map[string]string{
|
|
||||||
batch.JobTrackingFinalizer: "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Spec: batch.JobSpec{
|
|
||||||
Selector: validSelector,
|
|
||||||
Template: validPodTemplateSpec,
|
|
||||||
ManualSelector: ptr.To(true),
|
|
||||||
Parallelism: ptr.To[int32](1),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
update: func(job *batch.Job) {
|
|
||||||
job.Annotations["foo"] = "bar"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"deleting user annotation": {
|
|
||||||
job: &batch.Job{
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
|
||||||
Name: "myjob",
|
|
||||||
Namespace: metav1.NamespaceDefault,
|
|
||||||
ResourceVersion: "0",
|
|
||||||
Annotations: map[string]string{
|
|
||||||
batch.JobTrackingFinalizer: "",
|
|
||||||
"foo": "bar",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Spec: batch.JobSpec{
|
|
||||||
Selector: validSelector,
|
|
||||||
Template: validPodTemplateSpec,
|
|
||||||
ManualSelector: ptr.To(true),
|
|
||||||
Parallelism: ptr.To[int32](1),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
update: func(job *batch.Job) {
|
|
||||||
delete(job.Annotations, "foo")
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"updating node selector for unsuspended job disallowed": {
|
"updating node selector for unsuspended job disallowed": {
|
||||||
job: &batch.Job{
|
job: &batch.Job{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Loading…
Reference in New Issue
Block a user