Bug 2042027 - Incorrect feedback for "oc label pods --all"
Summary: Incorrect feedback for "oc label pods --all"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-18 17:27 UTC by Anna Savina
Modified: 2022-08-10 10:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 10:43:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
OCP4_10 (242.05 KB, image/png)
2022-01-18 17:27 UTC, Anna Savina
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:43:25 UTC

Description Anna Savina 2022-01-18 17:27:20 UTC
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

Comment 2 Maciej Szulik 2022-01-19 13:11:13 UTC
I've commented on the PR which introduced this problem https://github.com/kubernetes/kubernetes/pull/104372/files#r787728591

Comment 3 Maciej Szulik 2022-01-21 11:51:53 UTC
This will be fixed in k8s 1.24, see https://github.com/kubernetes/kubernetes/pull/107657

Comment 5 Maciej Szulik 2022-05-31 11:29:19 UTC
1.24 landed in  https://github.com/openshift/oc/pull/1092

Comment 7 zhou ying 2022-06-01 04:05:06 UTC
[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

Comment 9 errata-xmlrpc 2022-08-10 10:43:03 UTC
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


Note You need to log in before you can comment on or make changes to this bug.