Created attachment 1851669 [details] OCP4_10 Description of problem: Incorrect feedback for "oc label pods --all <label> --overwrite=true" --------------------------- Version-Release number of selected component (if applicable): 4.10.0-0.nightly-2022-01-17-091922 --------------------------- How reproducible: 100% --------------------------- Steps to Reproduce: 1. oc apply -f - << EOF > apiVersion: v1 > kind: Pod > metadata: > name: hello-openshift > spec: > nodeName: worker-0-0 > containers: > - name: hello-openshift > image: quay.io/openshifttest/hello-openshift@sha256:aaea76ff622d2f8bcb32e538e7b3cd0ef6d291953f3e7c9f556c1ba5baf47e2e > imagePullPolicy: IfNotPresent > EOF 2. oc apply -f - << EOF apiVersion: v1 kind: Pod metadata: name: hello-openshift2 spec: nodeName: worker-0-0 containers: - name: hello-openshift2 image: quay.io/openshifttest/hello-openshift@sha256:aaea76ff622d2f8bcb32e538e7b3cd0ef6d291953f3e7c9f556c1ba5baf47e2e imagePullPolicy: IfNotPresent EOF 3. oc label pods hello-openshift status=unhealthy 4. oc label pods --all status=healthy --overwrite=true --------------------------- Actual results: pod/hello-openshift unlabeled --------------------------- Expected results: pod/hello-openshift labeled --------------------------- Additional info: For OCP 4.9 test passed For OCP 4.10 result of command is right, just wrong feedback
I've commented on the PR which introduced this problem https://github.com/kubernetes/kubernetes/pull/104372/files#r787728591
This will be fixed in k8s 1.24, see https://github.com/kubernetes/kubernetes/pull/107657
1.24 landed in https://github.com/openshift/oc/pull/1092
[root@localhost ~]# oc get pods NAME READY STATUS RESTARTS AGE hello-openshift 1/1 Running 0 3s hello-openshift2 1/1 Running 0 2m56s [root@localhost ~]# oc label pods hello-openshift status=unhealthy pod/hello-openshift labeled [root@localhost ~]# oc label pods --all status=healthy --overwrite=true pod/hello-openshift labeled pod/hello-openshift2 labeled [root@localhost ~]# oc get pod --show-labels NAME READY STATUS RESTARTS AGE LABELS hello-openshift 1/1 Running 0 50s status=healthy hello-openshift2 1/1 Running 0 3m43s status=healthy [root@localhost ~]# oc version --client Client Version: 4.11.0-0.nightly-2022-05-26-013101 Kustomize Version: v4.5.4
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 (Important: OpenShift Container Platform 4.11.0 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-2022:5069