Description of problem: An error occurs when creating pods if configuring multiple key-only labels in default cluster-wide node selectors or project-wide node selectors. $ oc edit namespace test apiVersion: v1 kind: Namespace metadata: annotations: openshift.io/node-selector: node-role.kubernetes.io/test=,node-role.kubernetes.io/worker= $ oc describe replicaset httpd-7866578b78 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedCreate 8s (x11 over 14s) replicaset-controller Error creating: unable to parse requirement: found ',', expected: identifier If only the last label is a key-only label and the other labels are key=value labels, everything goes fine. $ oc edit namespace test apiVersion: v1 kind: Namespace metadata: annotations: openshift.io/node-selector: node-role.kubernetes.io/test=true,node-role.kubernetes.io/worker= $ oc describe replicaset httpd-7866578b78 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal SuccessfulCreate 19s replicaset-controller Created pod: httpd-7866578b78-kkmdt Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Configure default cluster-wide node selectors or project-wide node selectors with multiple key-only labels 2. Create a test app e.g. $ oc new-app httpd 3. Check the replicaset status $ oc describe replicaset httpd-xxxxxxxxxx Actual results: Error occurs Expected results: Pod get created with the correct node selector and no error occurs Additional info:
Looks like the labelselector parser needs a fix, there are 2 places: - https://github.com/openshift/openshift-apiserver/tree/master/pkg/apiserver/labelselector/ - https://github.com/openshift/kubernetes/tree/master/openshift-kube-apiserver/admission/scheduler/nodeenv/labelselector/ While at it, I'd suggest maybe moving that code into apiserver-library-go, maybe?
Sorry did not timely check it. Was fully occupied by burning down other on_qa bugs and other old and new focused-on work! Today checked in 4.8.0-0.nightly-2021-06-25-182927: oc login -u ... oc new-project xxia-proj oc edit ns xxia-proj --context admin # add annotation openshift.io/node-selector: node-role.kubernetes.io/test=true,node-role.kubernetes.io/worker= oc label no ONE_WORKER_NAME node-role.kubernetes.io/test= oc new-app httpd oc get po httpd-78bddd99bc-d2ncc 1/1 Running 0 65s oc describe rs # did not see above error
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:2438