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

Minor fixes for #3219 #3231

Merged
merged 1 commit into from
Dec 22, 2024
Merged

Minor fixes for #3219 #3231

merged 1 commit into from
Dec 22, 2024

Conversation

orenc1
Copy link
Collaborator

@orenc1 orenc1 commented Dec 22, 2024

  1. fix comment (should be masters instead of workers)
  2. use HaveValue matcher in unit tests.

What this PR does / why we need it:

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

Jira Ticket:


Release note:

NONE

@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. labels Dec 22, 2024
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. size/S 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 Dec 22, 2024
@coveralls
Copy link
Collaborator

coveralls commented Dec 22, 2024

Pull Request Test Coverage Report for Build 12455287120

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 71.739%

Files with Coverage Reduction New Missed Lines %
controllers/operands/operandHandler.go 3 86.14%
Totals Coverage Status
Change from base Build 12452728839: -0.04%
Covered Lines: 6138
Relevant Lines: 8556

💛 - Coveralls

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.

Added inline comments

Please also fix lines 3132-3133

@@ -3067,7 +3067,7 @@ Version: 1.2.3`)
Expect(err).ToNot(HaveOccurred())
Expect(kv.Spec.Infra).To(Not(BeNil()))
Expect(kv.Spec.Infra.Replicas).To(Not(BeNil()))
Expect(*kv.Spec.Infra.Replicas).To(Equal(uint8(1)))
Expect(*kv.Spec.Infra.Replicas).To(HaveValue(Equal(uint8(1))))
Copy link
Collaborator

Choose a reason for hiding this comment

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

HaveValue is working on the pointer - not the value.

Suggested change
Expect(*kv.Spec.Infra.Replicas).To(HaveValue(Equal(uint8(1))))
Expect(kv.Spec.Infra.Replicas).To(HaveValue(Equal(uint8(1))))

@@ -3022,7 +3022,7 @@ Version: 1.2.3`)
kv, err := NewKubeVirt(hco)
Expect(err).ToNot(HaveOccurred())
Expect(kv.Spec.Infra).To(Not(BeNil()))
Expect(*kv.Spec.Infra.Replicas).To(Equal(uint8(1)))
Expect(*kv.Spec.Infra.Replicas).To(HaveValue(Equal(uint8(1))))
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

@@ -3108,7 +3108,7 @@ Version: 1.2.3`)
Expect(err).ToNot(HaveOccurred())
Expect(kv.Spec.Infra).To(Not(BeNil()))
Expect(kv.Spec.Infra.Replicas).To(Not(BeNil()))
Expect(*kv.Spec.Infra.Replicas).To(Equal(uint8(1)))
Expect(*kv.Spec.Infra.Replicas).To(HaveValue(Equal(uint8(1))))
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

Copy link
Collaborator

Choose a reason for hiding this comment

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

line 3110 is not needed anymore

@@ -3067,7 +3067,7 @@ Version: 1.2.3`)
Expect(err).ToNot(HaveOccurred())
Expect(kv.Spec.Infra).To(Not(BeNil()))
Expect(kv.Spec.Infra.Replicas).To(Not(BeNil()))
Expect(*kv.Spec.Infra.Replicas).To(Equal(uint8(1)))
Expect(*kv.Spec.Infra.Replicas).To(HaveValue(Equal(uint8(1))))
Copy link
Collaborator

Choose a reason for hiding this comment

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

line 3069 is not needed when using HaveValue

1. fix comment (should be masters instead of workers)
2. use HaveValue matcher in unit tests.

Signed-off-by: Oren Cohen <[email protected]>
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.

/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 22, 2024
@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 Dec 22, 2024
// scheduled onto worker nodes.
// In case there are no control plane / master nodes in the cluster, we're setting
// an empty struct for NodePlacement so that kubevirt control plane pods won't have
// any affinity rules, and they could get scheduled onto worker nodes.
if hcoConfig.NodePlacement == nil && !controlPlaneNodeExists {
Copy link
Member

Choose a reason for hiding this comment

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

If comments are needed, it's probably because the code is too complex.
Please consider extracting the code to a properly named helper function.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dankenigsberg I agree with you in general, but here, this is a bit complex explanation. Not sure how to fit it into a function name.

@nunnatsa
Copy link
Collaborator

/test pull-hyperconverged-cluster-operator-unit-test-s390x

Copy link

openshift-ci bot commented Dec 22, 2024

@nunnatsa: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test ci-index-hco-bundle
/test ci-index-hco-upgrade-operator-sdk-bundle
/test hco-e2e-consecutive-operator-sdk-upgrades-aws
/test hco-e2e-consecutive-operator-sdk-upgrades-azure
/test hco-e2e-kv-smoke-azure
/test hco-e2e-kv-smoke-gcp
/test hco-e2e-operator-sdk-aws
/test hco-e2e-operator-sdk-azure
/test hco-e2e-operator-sdk-gcp
/test hco-e2e-upgrade-operator-sdk-aws
/test hco-e2e-upgrade-operator-sdk-azure
/test hco-e2e-upgrade-prev-operator-sdk-aws
/test hco-e2e-upgrade-prev-operator-sdk-azure
/test images
/test okd-ci-index-hco-bundle
/test okd-ci-index-hco-upgrade-operator-sdk-bundle
/test okd-images

The following commands are available to trigger optional jobs:

/test hco-e2e-operator-sdk-sno-aws
/test hco-e2e-operator-sdk-sno-azure
/test hco-e2e-upgrade-operator-sdk-sno-aws
/test hco-e2e-upgrade-operator-sdk-sno-azure
/test hco-e2e-upgrade-prev-operator-sdk-sno-aws
/test hco-e2e-upgrade-prev-operator-sdk-sno-azure
/test okd-hco-e2e-operator-sdk-aws
/test okd-hco-e2e-operator-sdk-gcp
/test okd-hco-e2e-upgrade-operator-sdk-aws
/test okd-hco-e2e-upgrade-operator-sdk-gcp

Use /test all to run the following jobs that were automatically triggered:

pull-ci-kubevirt-hyperconverged-cluster-operator-main-ci-index-hco-bundle
pull-ci-kubevirt-hyperconverged-cluster-operator-main-ci-index-hco-upgrade-operator-sdk-bundle
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-consecutive-operator-sdk-upgrades-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-consecutive-operator-sdk-upgrades-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-kv-smoke-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-kv-smoke-gcp
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-gcp
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-sno-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-sno-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-operator-sdk-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-operator-sdk-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-operator-sdk-sno-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-operator-sdk-sno-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-prev-operator-sdk-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-prev-operator-sdk-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-prev-operator-sdk-sno-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-prev-operator-sdk-sno-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-images
pull-ci-kubevirt-hyperconverged-cluster-operator-main-okd-ci-index-hco-bundle
pull-ci-kubevirt-hyperconverged-cluster-operator-main-okd-ci-index-hco-upgrade-operator-sdk-bundle
pull-ci-kubevirt-hyperconverged-cluster-operator-main-okd-images

In response to this:

/test pull-hyperconverged-cluster-operator-unit-test-s390x

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-sigs/prow repository.

@kubevirt-bot
Copy link
Contributor

@openshift-ci[bot]: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test build-hco-test-utils-image
  • /test pull-hyperconverged-cluster-operator-e2e-k8s-1.30
  • /test pull-hyperconverged-cluster-operator-e2e-k8s-1.31

The following commands are available to trigger optional jobs:

  • /test pull-hyperconverged-cluster-operator-unit-test-s390x

Use /test all to run the following jobs that were automatically triggered:

  • pull-hyperconverged-cluster-operator-e2e-k8s-1.30
  • pull-hyperconverged-cluster-operator-e2e-k8s-1.31
  • pull-hyperconverged-cluster-operator-unit-test-s390x

In response to this:

@nunnatsa: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test ci-index-hco-bundle
/test ci-index-hco-upgrade-operator-sdk-bundle
/test hco-e2e-consecutive-operator-sdk-upgrades-aws
/test hco-e2e-consecutive-operator-sdk-upgrades-azure
/test hco-e2e-kv-smoke-azure
/test hco-e2e-kv-smoke-gcp
/test hco-e2e-operator-sdk-aws
/test hco-e2e-operator-sdk-azure
/test hco-e2e-operator-sdk-gcp
/test hco-e2e-upgrade-operator-sdk-aws
/test hco-e2e-upgrade-operator-sdk-azure
/test hco-e2e-upgrade-prev-operator-sdk-aws
/test hco-e2e-upgrade-prev-operator-sdk-azure
/test images
/test okd-ci-index-hco-bundle
/test okd-ci-index-hco-upgrade-operator-sdk-bundle
/test okd-images

The following commands are available to trigger optional jobs:

/test hco-e2e-operator-sdk-sno-aws
/test hco-e2e-operator-sdk-sno-azure
/test hco-e2e-upgrade-operator-sdk-sno-aws
/test hco-e2e-upgrade-operator-sdk-sno-azure
/test hco-e2e-upgrade-prev-operator-sdk-sno-aws
/test hco-e2e-upgrade-prev-operator-sdk-sno-azure
/test okd-hco-e2e-operator-sdk-aws
/test okd-hco-e2e-operator-sdk-gcp
/test okd-hco-e2e-upgrade-operator-sdk-aws
/test okd-hco-e2e-upgrade-operator-sdk-gcp

Use /test all to run the following jobs that were automatically triggered:

pull-ci-kubevirt-hyperconverged-cluster-operator-main-ci-index-hco-bundle
pull-ci-kubevirt-hyperconverged-cluster-operator-main-ci-index-hco-upgrade-operator-sdk-bundle
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-consecutive-operator-sdk-upgrades-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-consecutive-operator-sdk-upgrades-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-kv-smoke-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-kv-smoke-gcp
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-gcp
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-sno-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-operator-sdk-sno-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-operator-sdk-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-operator-sdk-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-operator-sdk-sno-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-operator-sdk-sno-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-prev-operator-sdk-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-prev-operator-sdk-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-prev-operator-sdk-sno-aws
pull-ci-kubevirt-hyperconverged-cluster-operator-main-hco-e2e-upgrade-prev-operator-sdk-sno-azure
pull-ci-kubevirt-hyperconverged-cluster-operator-main-images
pull-ci-kubevirt-hyperconverged-cluster-operator-main-okd-ci-index-hco-bundle
pull-ci-kubevirt-hyperconverged-cluster-operator-main-okd-ci-index-hco-upgrade-operator-sdk-bundle
pull-ci-kubevirt-hyperconverged-cluster-operator-main-okd-images

In response to this:

/test pull-hyperconverged-cluster-operator-unit-test-s390x

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-sigs/prow repository.

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-sigs/prow repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 22, 2024

hco-e2e-consecutive-operator-sdk-upgrades-aws lane succeeded.
/override ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

In response to this:

hco-e2e-consecutive-operator-sdk-upgrades-aws lane succeeded.
/override ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure

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-sigs/prow repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 22, 2024

hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

In response to this:

hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

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-sigs/prow repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 22, 2024

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

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

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-sigs/prow repository.

@nunnatsa
Copy link
Collaborator

/retest

Copy link

openshift-ci bot commented Dec 22, 2024

@orenc1: 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-consecutive-operator-sdk-upgrades-azure eacf86c link true /test hco-e2e-consecutive-operator-sdk-upgrades-azure
ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure eacf86c link true /test hco-e2e-upgrade-prev-operator-sdk-azure
ci/prow/hco-e2e-kv-smoke-azure eacf86c link true /test hco-e2e-kv-smoke-azure
ci/prow/hco-e2e-upgrade-operator-sdk-sno-aws eacf86c link false /test hco-e2e-upgrade-operator-sdk-sno-aws

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-sigs/prow repository. I understand the commands that are listed here.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 22, 2024

hco-e2e-upgrade-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-operator-sdk-azure

In response to this:

hco-e2e-upgrade-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-azure

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-sigs/prow repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 22, 2024

hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-sno-azure

In response to this:

hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

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-sigs/prow repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 22, 2024

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

hco-e2e-upgrade-operator-sdk-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-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-sigs/prow repository.

@kubevirt-bot kubevirt-bot merged commit fc5d5b1 into kubevirt:main Dec 22, 2024
32 checks passed
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-none Denotes a PR that doesn't merit a release note. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants