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

Fix issues with high availability detection #3205

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

nunnatsa
Copy link
Collaborator

What this PR does / why we need it:

  • make the status field a pointer to bool, to distinglish between false and field not set.
  • On mutation webhook, fix the eviction strategy if SNO becam HA.
  • fix an issue where the status field is not set if no node is added or deleted.
  • fix unit test (assert old HCO instead of HCO from client)
  • fix issue in the node controller, to ignore error if HCO is not present.

Jira Ticket:

none

Release note:

None

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Dec 12, 2024
@nunnatsa nunnatsa force-pushed the fix-ha branch 2 times, most recently from 5707fea to 0ceb18b Compare December 12, 2024 14:31
@coveralls
Copy link
Collaborator

coveralls commented Dec 12, 2024

Pull Request Test Coverage Report for Build 12338107598

Details

  • 27 of 34 (79.41%) changed or added relevant lines in 4 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.06%) to 71.68%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/components/components.go 0 1 0.0%
controllers/nodes/nodes_controller.go 8 14 57.14%
Files with Coverage Reduction New Missed Lines %
controllers/commontestutils/testUtils.go 3 52.84%
Totals Coverage Status
Change from base Build 12337030246: 0.06%
Covered Lines: 6120
Relevant Lines: 8538

💛 - Coveralls

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 12, 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.

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 13, 2024
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 15, 2024
@nunnatsa nunnatsa force-pushed the fix-ha branch 3 times, most recently from fca9890 to da1d244 Compare December 15, 2024 07:16
@hco-bot
Copy link
Collaborator

hco-bot commented Dec 15, 2024

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure
hco-e2e-upgrade-prev-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-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 15, 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 15, 2024

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

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

@nunnatsa nunnatsa force-pushed the fix-ha branch 2 times, most recently from 522e4b4 to a011b34 Compare December 15, 2024 10:05
* add the missing "watch" permission for nodes.
* make the status field a pointer to bool, to distinglish between false
  and field not set.
* On mutation webhook, fix the eviction strategy if SNO becam HA.
* fix an issue where the status field is not set if no node is added or
  deleted.
* fix unit test (assert old HCO instead of HCO from client)
* fix issue in the node controller, to ignore error if HCO is not
  present.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
@hco-bot
Copy link
Collaborator

hco-bot commented Dec 15, 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 15, 2024

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

hco-e2e-operator-sdk-gcp, hco-e2e-operator-sdk-aws lanes succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure
hco-e2e-upgrade-prev-operator-sdk-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-aws
hco-e2e-operator-sdk-sno-azure lane succeeded.
/override ci/prow/hco-e2e-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.

@nunnatsa
Copy link
Collaborator Author

/retest

@nunnatsa
Copy link
Collaborator Author

/cherry-pick release-1.13

@kubevirt-bot
Copy link
Contributor

@nunnatsa: once the present PR merges, I will cherry-pick it on top of release-1.13 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.13

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.

Copy link

openshift-ci bot commented Dec 16, 2024

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

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 16, 2024

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

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

Copy link
Collaborator

@orenc1 orenc1 left a comment

Choose a reason for hiding this comment

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

/approve
/thanks

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2024
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: orenc1

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 16, 2024
@kubevirt-bot kubevirt-bot merged commit d863220 into kubevirt:main Dec 16, 2024
32 checks passed
@kubevirt-bot
Copy link
Contributor

@nunnatsa: #3205 failed to apply on top of branch "release-1.13":

Applying: Fix issues with high availability detection
Using index info to reconstruct a base tree...
M	api/v1beta1/hyperconverged_types.go
M	controllers/hyperconverged/hyperconverged_controller.go
M	deploy/cluster_role.yaml
A	deploy/index-image/community-kubevirt-hyperconverged/1.14.0/manifests/kubevirt-hyperconverged-operator.v1.14.0.clusterserviceversion.yaml
A	deploy/olm-catalog/community-kubevirt-hyperconverged/1.14.0/manifests/kubevirt-hyperconverged-operator.v1.14.0.clusterserviceversion.yaml
M	docs/api.md
M	pkg/components/components.go
M	tests/func-tests/node_placement_test.go
Falling back to patching base and 3-way merge...
Auto-merging tests/func-tests/node_placement_test.go
Auto-merging pkg/components/components.go
Auto-merging docs/api.md
Auto-merging deploy/olm-catalog/community-kubevirt-hyperconverged/1.13.1/manifests/kubevirt-hyperconverged-operator.v1.13.1.clusterserviceversion.yaml
CONFLICT (content): Merge conflict in deploy/olm-catalog/community-kubevirt-hyperconverged/1.13.1/manifests/kubevirt-hyperconverged-operator.v1.13.1.clusterserviceversion.yaml
Auto-merging deploy/index-image/community-kubevirt-hyperconverged/1.13.1/manifests/kubevirt-hyperconverged-operator.v1.13.1.clusterserviceversion.yaml
Auto-merging deploy/cluster_role.yaml
Auto-merging controllers/hyperconverged/hyperconverged_controller.go
Auto-merging api/v1beta1/hyperconverged_types.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Fix issues with high availability detection

In response to this:

/cherry-pick release-1.13

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 nunnatsa deleted the fix-ha branch December 16, 2024 10:15
nunnatsa added a commit to nunnatsa/hyperconverged-cluster-operator that referenced this pull request Dec 16, 2024
* add the missing "watch" permission for nodes.
* make the status field a pointer to bool, to distinglish between false
  and field not set.
* On mutation webhook, fix the eviction strategy if SNO becam HA.
* fix an issue where the status field is not set if no node is added or
  deleted.
* fix unit test (assert old HCO instead of HCO from client)
* fix issue in the node controller, to ignore error if HCO is not
  present.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
nunnatsa added a commit to nunnatsa/hyperconverged-cluster-operator that referenced this pull request Dec 16, 2024
* add the missing "watch" permission for nodes.
* make the status field a pointer to bool, to distinglish between false
  and field not set.
* On mutation webhook, fix the eviction strategy if SNO becam HA.
* fix an issue where the status field is not set if no node is added or
  deleted.
* fix unit test (assert old HCO instead of HCO from client)
* fix issue in the node controller, to ignore error if HCO is not
  present.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
kubevirt-bot pushed a commit that referenced this pull request Dec 17, 2024
* validate-bundles: remove sudo usage (#3210)

the make sanity github action has started to fail for using the sudo directive in this context.

Signed-off-by: Oren Cohen <[email protected]>

* Fix issues with high availability detection (#3205)

* add the missing "watch" permission for nodes.
* make the status field a pointer to bool, to distinglish between false
  and field not set.
* On mutation webhook, fix the eviction strategy if SNO becam HA.
* fix an issue where the status field is not set if no node is added or
  deleted.
* fix unit test (assert old HCO instead of HCO from client)
* fix issue in the node controller, to ignore error if HCO is not
  present.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>

---------

Signed-off-by: Oren Cohen <[email protected]>
Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
Co-authored-by: Oren Cohen <[email protected]>
orenc1 added a commit to orenc1/hyperconverged-cluster-operator that referenced this pull request Dec 23, 2024
…3209)

* validate-bundles: remove sudo usage (kubevirt#3210)

the make sanity github action has started to fail for using the sudo directive in this context.

Signed-off-by: Oren Cohen <[email protected]>

* Fix issues with high availability detection (kubevirt#3205)

* add the missing "watch" permission for nodes.
* make the status field a pointer to bool, to distinglish between false
  and field not set.
* On mutation webhook, fix the eviction strategy if SNO becam HA.
* fix an issue where the status field is not set if no node is added or
  deleted.
* fix unit test (assert old HCO instead of HCO from client)
* fix issue in the node controller, to ignore error if HCO is not
  present.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>

---------

Signed-off-by: Oren Cohen <[email protected]>
Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
Co-authored-by: Oren Cohen <[email protected]>
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/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants