Description of problem: `oc patch --type=strategic` should prompt the required key's name when updating array element Version-Release number of selected component (if applicable): OCP v3.9.0-0.9.0 Seems it is server issue, because testing with oc v3.9.0-0.9.0 against server v3.9.0-0.8.0 can prompt the required key's name, as shown in below "[Note 1]" How reproducible: Always Steps to Reproduce: 1. Create resource whose YAML has array, e.g. $ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/services/multi-portsvc.json $ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/deployment/rc-with-two-containers.yaml 2. Run `oc patch --type=strategic ...` (--type=strategic is by default) a) $ oc patch svc multi-portsvc --type=strategic -p ' spec: ports: - targetPort: 441' b) $ oc patch rc rctest -p=' spec: template: spec: containers: - resources: limits: memory: 258Mi' Actual results: 2. It improves readability than before [Note 1], but it doesn't prompt the name of the required key's name to user a) Output is: The Service "multi-portsvc" is invalid: spec.ports: Required value b) Output is: The ReplicationController "rctest" is invalid: spec.template.spec.containers: Required value * [Note 1] Before, the output is not good to read, but it can show the required key's name: Error from server: map: map[targetPort:441] does not contain declared merge key: port Expected results: 2. Should prompt the required key's name to user Additional info:
I don't see an issue either. Can you open one upstream?
Upstream issue: https://github.com/kubernetes/kubernetes/issues/57834
Upstream PR: https://github.com/kubernetes/kubernetes/pull/57854
Downstream: https://github.com/openshift/origin/pull/18331
Downstream PR was just merged 3 hours ago and does not come in OCP yet. Waiting for it coming to OCP next version to verify it
Checked in OCP v3.9.0-0.36.0, now the steps in bug description return respectively: Error from server: map: map[targetPort:441] does not contain declared merge key: port Error from server: map: map[resources:map[limits:map[memory:258Mi]]] does not contain declared merge key: name i.e., they prompt the name of the required key