I'm trying to set the default project node selector to empty string as documented here: https://blog.openshift.com/deploying-applications-to-specific-nodes/ This works if I use oc edit, but it doesn't work with oc patch. the patch command execute successfully bit the object is left unchanged. here is an example: oc patch project glusterfs --patch '{ "metadata":{"annotation": { "openshift.io/node-selector": "" }}}'
(In reply to raffaele spazzoli from comment #0) > here is an example: > oc patch project glusterfs --patch '{ "metadata":{"annotation": { > "openshift.io/node-selector": "" }}}' Thanks for the report. Try plural "annotations", it works: Before empty patch: $ oc get namespace xxia-proj -o yaml | grep openshift.io/node-selector openshift.io/node-selector: region=primary Now empty patch: $ oc patch namespace xxia-proj --patch '{ "metadata":{"annotations": {"openshift.io/node-selector": "" }}}' # Run via cluster-admin After empty patch: $ oc get namespace xxia-proj -o yaml | grep openshift.io/node-selector openshift.io/node-selector: "" Also, should use "oc patch namespace ... " instead of "oc patch project ...". The latter will show "metadata.annotations[openshift.io/node-selector] ... field is immutable, try updating the namespace" (As for this, see bug 1386401) As for your report, see related bug 1267454
The command: $ oc patch namespace xxia-proj --patch '{ "metadata":{"annotations": {"openshift.io/node-selector": "" }}}' # Run via cluster-admin works as described. Closing as not a bug.
(In reply to Derek Carr from comment #2) > Closing as not a bug. Right. But IMO, at the beginning I didn't notice comment 0 uses singular "annotation" and just copied its command to reproduce, nearly thinking it as regression bug. Singular "annotation" is kind of "non-existing field" said in bug 1267454, which causes UX problem and makes user confusion like the reporter of this bug. Looking forward to the fix of bug 1267454