Bug 1473429 - Unable to patch out finalizers on job
Summary: Unable to patch out finalizers on job
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.6.z
Assignee: David Eads
QA Contact: Xiaoli Tian
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-20 19:47 UTC by Eric Paris
Modified: 2019-11-21 18:37 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-21 18:37:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Eric Paris 2017-07-20 19:47:55 UTC
oc v3.6.126.1

oc patch -n "${ns}" "${job}" --type=json --patch='[ { "op":"remove", "path": "/metadata/finalizers" }]'

resulted in


The Job "scheduled-job-test-1497220260" is invalid: spec.template: Invalid value: api.PodTemplateSpec{ObjectMeta:v1.ObjectMeta{Name:"", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string{"controller-uid":"a744ad73-4ef5-11e7-b1dd-122631632f42", "job-name":"scheduled-job-test-1497220260"}, Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:api.PodSpec{Volumes:[]api.Volume(nil), InitContainers:[]api.Container(nil), Containers:[]api.Container{api.Container{Name:"test-job-container", Image:"172.30.208.107:5000/myns/python-35-test-2@sha256:0fcb3f46d643f896a80facfdff8d8de2ac66c03432cf1967c6abe6f1bdffffff", Command:[]string{"python", "./test_job.py"}, Args:[]string(nil), WorkingDir:"", Ports:[]api.ContainerPort(nil), EnvFrom:[]api.EnvFromSource(nil), Env:[]api.EnvVar(nil), Resources:api.ResourceRequirements{Limits:api.ResourceList(nil), Requests:api.ResourceList(nil)}, VolumeMounts:[]api.VolumeMount(nil), LivenessProbe:(*api.Probe)(nil), ReadinessProbe:(*api.Probe)(nil), Lifecycle:(*api.Lifecycle)(nil), TerminationMessagePath:"/dev/termination-log", TerminationMessagePolicy:"File", ImagePullPolicy:"Always", SecurityContext:(*api.SecurityContext)(nil), Stdin:false, StdinOnce:false, TTY:false}}, RestartPolicy:"Never", TerminationGracePeriodSeconds:(*int64)(0xc6e36da660), ActiveDeadlineSeconds:(*int64)(nil), DNSPolicy:"ClusterFirst", NodeSelector:map[string]string(nil), ServiceAccountName:"", AutomountServiceAccountToken:(*bool)(nil), NodeName:"", SecurityContext:(*api.PodSecurityContext)(0xc637c25d00), ImagePullSecrets:[]api.LocalObjectReference(nil), Hostname:"", Subdomain:"", Affinity:(*api.Affinity)(nil), SchedulerName:"default-scheduler", Tolerations:[]api.Toleration(nil)}}: field is immutable

Comment 2 David Eads 2017-07-20 20:26:27 UTC
Thanks for the details.  tracking it down, we are hitting this: https://github.com/openshift/origin/pull/15118

Comment 3 Jordan Liggitt 2017-07-21 13:14:10 UTC
Fixed in v3.6.141-1

https://github.com/openshift/ose/commit/f779a7339b66ad94c927f0d7f31aca0546fb80ae

Comment 4 Weihua Meng 2017-07-25 09:34:35 UTC
I cannot reproduce it.
Eric, could you show more detailed info to reproduce it? Thanks.

Comment 5 Weihua Meng 2017-07-27 13:59:30 UTC
David, could you provide detailed reproduce steps? Thanks.

Comment 6 David Eads 2017-07-27 14:02:30 UTC
You can 
 1. turn off the image policy admission plugin
 2. create a job that would be updated
 3. turn on the image policy admission plugin and have it set to mutate the job
 4. delete the job with an orphaning policy
 5. on the old code, the job should be stuck since patch would fail.  on the new code, the job should be deleted.

Comment 7 DeShuai Ma 2017-07-28 09:25:51 UTC
Verified on openshift v3.6.172.0.0
kubernetes v1.6.1+5115d708d7
etcd 3.2.1


Note You need to log in before you can comment on or make changes to this bug.