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
Thanks for the details. tracking it down, we are hitting this: https://github.com/openshift/origin/pull/15118
Fixed in v3.6.141-1 https://github.com/openshift/ose/commit/f779a7339b66ad94c927f0d7f31aca0546fb80ae
I cannot reproduce it. Eric, could you show more detailed info to reproduce it? Thanks.
David, could you provide detailed reproduce steps? Thanks.
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.
Verified on openshift v3.6.172.0.0 kubernetes v1.6.1+5115d708d7 etcd 3.2.1