Bug 2001385 - no "name" label in virt-operator pod
Summary: no "name" label in virt-operator pod
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 4.9.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.11.0
Assignee: Barak
QA Contact: Akriti Gupta
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-05 22:28 UTC by ibesso
Modified: 2023-11-13 08:18 UTC (History)
6 users (show)

Fixed In Version: hco-bundle-registry-container-v4.11.0-315 virt-operator-container-v4.11.0-55
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-14 19:28:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 7223 0 None Merged Add a name label to virt-operator pods 2022-05-06 08:45:52 UTC
Red Hat Issue Tracker CNV-14049 0 None None None 2023-11-13 08:18:14 UTC
Red Hat Product Errata RHSA-2022:6526 0 None None None 2022-09-14 19:28:30 UTC

Description ibesso 2021-09-05 22:28:25 UTC
Description of problem:
----------------------
Among the OLM deployments within the openshift-cnv namespace, virt-operator pod is one that does not have a name label.


Version-Release number of selected component (if applicable):
------------------------------------------------------------
4.9.0-167


How reproducible:
----------------
100%


Steps to Reproduce:
------------------
$ oc get pod -n openshift-cnv virt-operator-9b97486b-gq7rn -ojson |jq '.metadata.labels'
{
  "app.kubernetes.io/component": "compute",
  "app.kubernetes.io/managed-by": "olm",
  "app.kubernetes.io/part-of": "hyperconverged-cluster",
  "app.kubernetes.io/version": "v4.9.0",
  "kubevirt.io": "virt-operator",
  "pod-template-hash": "9b97486b",
  "prometheus.kubevirt.io": ""
}



Actual results:
--------------
no "name" label.


Expected results:
----------------
The pod should have a name label, e.g. "name": "virt-operator".


Additional info:

Comment 1 Jed Lejosne 2021-09-07 20:07:13 UTC
Indeed. It's not just virt-operator however, some openshift-cnv pods seem to have a name labels and some not (28 with vs. 18 without on my cluster)
@ibesso Are all openshift-cnv pods expected to have a name label? If so, is that a new OCP operator requirement?
Thanks!

Comment 3 Jed Lejosne 2021-09-08 12:43:51 UTC
@ibesso also please clarify if the full expected label is "app.kubernetes.io/name" or just "name".
The former probably makes more sense.

Comment 4 sgott 2021-09-09 12:56:31 UTC
Re-assigning this BZ to the Installation component as the virt-operator pod itself is actually managed by HCO. Please re-assign if you feel this action is in error.

Comment 6 ibesso 2021-09-10 06:48:27 UTC
(In reply to Jed Lejosne from comment #3)
> @ibesso also please clarify if the full expected label is
> "app.kubernetes.io/name" or just "name".
> The former probably makes more sense.

just "name", as i see in all other operators pods ($ oc get pod -l "app.kubernetes.io/managed-by=olm" -n openshift-cnv -ojson |jq '.items[].metadata.labels').

Comment 7 ibesso 2021-09-10 06:50:48 UTC
(In reply to Jed Lejosne from comment #1)
> Indeed. It's not just virt-operator however, some openshift-cnv pods seem to
> have a name labels and some not (28 with vs. 18 without on my cluster)
> @ibesso Are all openshift-cnv pods expected to have a name label?
> If so, is that a new OCP operator requirement?
> Thanks!

It was not due to a requirement. I needed to use label selector filter to gather all pods in question for my tests.
@stirabos , could you please address this question?

Comment 9 Simone Tiraboschi 2021-09-14 09:36:33 UTC
(In reply to sgott from comment #4)
> Re-assigning this BZ to the Installation component as the virt-operator pod
> itself is actually managed by HCO. Please re-assign if you feel this action
> is in error.

The set of labels for virt-operator pods is defined in spec.template.metadata.labels stanza for the virt-operator deployment in the CSV.
This is entirely managed by virt-operator itself when rendering its part of the CSV.
Due to this, moving back to virt component.

I also want to add that the initial agreement on "required" labels was only about:
 app.kubernetes.io/managed-by: olm
 app.kubernetes.io/version: value of env variable HCO_KV_IO_VERSION
 app.kubernetes.io/component: network, storage, import, compute etc.
 app.kubernetes.io/part-of: hyperconverged-cluster

And currently we already have:
        spec:
          template:
            metadata:
              labels:
                app.kubernetes.io/component: compute
                app.kubernetes.io/managed-by: olm
                app.kubernetes.io/part-of: hyperconverged-cluster
                app.kubernetes.io/version: v4.9.0
                kubevirt.io: virt-operator
                prometheus.kubevirt.io: "" 

So the bare minimal required are already satisfied.

Comment 10 ibesso 2021-09-14 11:25:26 UTC
Following Simone's comment, even if it is not required, I thought we could add it to have the "name" label consistently in other pods as well.
Apart from that, it could help in my tests, as mentioned in comment 5.

Please consider all factors and decide whether the bug should be closed or not.

Comment 11 sgott 2021-09-14 13:42:37 UTC
Thanks for clarifying and sorry for the confusion.

Comment 13 sgott 2022-02-08 19:12:49 UTC
Removed [RFE] from BZ name as this is a bug, not a feature. Targetted for the next release for now.

Comment 14 Barak 2022-02-13 12:19:43 UTC
Update:
Created a PR about it:
https://github.com/kubevirt/kubevirt/pull/7223

Comment 15 Akriti Gupta 2022-05-06 13:03:42 UTC
Checked with: iib:219905

The virt-operator pod have a name label


[cnv-qe-jenkins@virt-akr-411-jpqfs-executor ~]$ oc get pod -n openshift-cnv virt-operator-5fc6844bd-fw2vq -ojson |jq '.metadata.labels'
{
  "app.kubernetes.io/component": "compute",
  "app.kubernetes.io/managed-by": "olm",
  "app.kubernetes.io/part-of": "hyperconverged-cluster",
  "app.kubernetes.io/version": "4.11.0",
  "kubevirt.io": "virt-operator",
  "name": "virt-operator",
  "pod-template-hash": "5fc6844bd",
  "prometheus.kubevirt.io": "true"
}

Comment 18 errata-xmlrpc 2022-09-14 19:28:21 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 Virtualization 4.11.0 Images security and bug fix 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:6526


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