Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose part-of,component and version labels to kubevirtCR #1712

Merged
merged 1 commit into from Jan 19, 2022
Merged

Expose part-of,component and version labels to kubevirtCR #1712

merged 1 commit into from Jan 19, 2022

Conversation

Barakmor1
Copy link
Member

@Barakmor1 Barakmor1 commented Jan 18, 2022

for unique labels values and exposure across kubevirt's components.
kubevirt's operator set it's components labels by kubevirtCR:
https://github.com/kubevirt/kubevirt/blob/9a9080b8a387b4a23d641353b3e22d3e9cc614ff/pkg/virt-operator/resource/apply/reconcile.go#L85

currently KubeVirt's components don't expose version and part-of labels,
component label isn't unique because KubeVirt's components that are managed by
virt-operator and virt-operator set these label to the default value ("kubevirt").

Steps to Reproduce **missing labels**:
1.deploy latest 4.10 cluster
2.check labels of virt components
virt-api
$ oc describe deployment virt-api -n openshift-cnv | head
Labels:                 app.kubernetes.io/component=kubevirt
                        app.kubernetes.io/managed-by=virt-operator
                        app.kubernetes.io/name=virt-api
                        kubevirt.io=virt-api

virt-handler
labels:
                        app.kubernetes.io/component: kubevirt
                        app.kubernetes.io/managed-by: virt-operator

virt-controller
Labels:                 app.kubernetes.io/component=kubevirt
                        app.kubernetes.io/managed-by=virt-operator
                        app.kubernetes.io/name=virt-controller
                        kubevirt.io=virt-controller

only Virt-operator have "part-of" and "version"
Labels:                 app.kubernetes.io/component=compute
                        app.kubernetes.io/managed-by=olm
                        app.kubernetes.io/part-of=hyperconverged-cluster
                        app.kubernetes.io/version=4.10.0
                        olm.deployment-spec-hash=7c7c9f8c59
                        olm.owner=kubevirt-hyperconverged-operator.v4.10.0
                        olm.owner.kind=ClusterServiceVersion


Expected results:
all virt components have label "part-of" and "version"

-----------------------------------------------------------------------------------------------------------------------------------------------
Steps to Reproduce **Inconsistent  comonent's label value**:
1.get labels of all virt component
virt-operator is "compute"
$ oc describe deployment virt-operator -n openshift-cnv | head
Labels:                 app.kubernetes.io/component=compute
                        app.kubernetes.io/managed-by=olm
                        app.kubernetes.io/part-of=hyperconverged-cluster
                        app.kubernetes.io/version=4.10.0
                        olm.deployment-spec-hash=7c7c9f8c59
                        olm.owner=kubevirt-hyperconverged-operator.v4.10.0
                        olm.owner.kind=ClusterServiceVersion

Virt-api, Virt-controller and virt-handler, the label is "kubevirt"
Labels:                 app.kubernetes.io/component=kubevirt
                        app.kubernetes.io/managed-by=virt-operator
                        app.kubernetes.io/name=virt-api
                        kubevirt.io=virt-api


Expected results:
all virt parts should have same label of component ,
Component values for Storage, network match, but it does NOT match for Virt.

Reviewer Checklist

Reviewers are supposed to review the PR for every aspect below one by one. To check an item means the PR is either "OK" or "Not Applicable" in terms of that item. All items are supposed to be checked before merging a PR.

  • PR Message
  • Commit Messages
  • How to test
  • Unit Tests
  • Functional Tests
  • User Documentation
  • Developer Documentation
  • Upgrade Scenario
  • Uninstallation Scenario
  • Backward Compatibility
  • Troubleshooting Friendly

Release note:

Add unique part-of,component and version labels values across KubeVirt's components.

@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XS labels Jan 18, 2022
@Barakmor1
Copy link
Member Author

/cc @nunnatsa

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 18, 2022
Copy link
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the title. Should be part-of instead of managed-by.

Please add release notes to the description

spec := kubevirtcorev1.KubeVirtSpec{
UninstallStrategy: uninstallStrategy,
Infra: hcoConfig2KvConfig(hc.Spec.Infra, infrastructureHighlyAvailable),
Workloads: hcoConfig2KvConfig(hc.Spec.Workloads, true),
Configuration: *config,
CertificateRotationStrategy: *kvCertConfig,
WorkloadUpdateStrategy: hcWorkloadUpdateStrategyToKv(hc.Spec.WorkloadUpdateStrategy),
ProductName: hcoutil.HyperConvergedCluster,
ProductVersion: os.Getenv(hcoutil.HcoKvIoVersionName),
ProductComponent: kv.ObjectMeta.Labels[hcoutil.AppLabelComponent],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set hcoutil.AppComponentCompute because this is the constant value we set on kv.ObjectMeta.Labels[hcoutil.AppLabelComponent]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reviewing.
Done. :)

@Barakmor1 Barakmor1 changed the title Expose managed-by,component and version labels to kubevirtCR Expose part-of,component and version labels to kubevirtCR Jan 18, 2022
for unique labels values and exposure across kubevirt's components.

Signed-off-by: Barak Mordehai <bmordeha@redhat.com>
@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2022

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-azure
hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-azure, ci/prow/hco-e2e-image-index-gcp

In response to this:

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-azure
hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-gcp

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sonarcloud
Copy link

sonarcloud bot commented Jan 18, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 1712912021

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 85.242%

Totals Coverage Status
Change from base Build 1708968065: 0.01%
Covered Lines: 3558
Relevant Lines: 4174

💛 - Coveralls

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jan 18, 2022
@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2022

hco-e2e-image-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-aws
hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp, ci/prow/hco-e2e-image-index-sno-aws

In response to this:

hco-e2e-image-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-aws
hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-gcp

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2022

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-sno-aws

In response to this:

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2022

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-gcp

In response to this:

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@nunnatsa
Copy link
Collaborator

/retest

@openshift-ci
Copy link

openshift-ci bot commented Jan 19, 2022

@Barakmor1: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/hco-e2e-upgrade-index-sno-aws 83554b0 link false /test hco-e2e-upgrade-index-sno-aws
ci/prow/hco-e2e-image-index-gcp 83554b0 link true /test hco-e2e-image-index-gcp
ci/prow/hco-e2e-image-index-sno-aws 83554b0 link false /test hco-e2e-image-index-sno-aws
ci/prow/hco-e2e-kv-smoke-gcp 83554b0 link true /test hco-e2e-kv-smoke-gcp

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Barakmor1
Copy link
Member Author

/retest

@nunnatsa
Copy link
Collaborator

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2022
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 19, 2022
@kubevirt-bot kubevirt-bot merged commit 408b888 into kubevirt:main Jan 19, 2022
@nunnatsa
Copy link
Collaborator

/cherry-pick release-1.6

@kubevirt-bot
Copy link
Contributor

@nunnatsa: new pull request created: #1723

In response to this:

/cherry-pick release-1.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants