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

Opt-out from cluster-wide default node selector #1799

Merged
merged 1 commit into from
Mar 13, 2022

Conversation

tiraboschi
Copy link
Member

The hyperconverged cluster operator defines
its own node selectors APIs that schedules
deployments and daemon sets on nodes according to
infra and workload classification.
Opting out from cluster-wide default node selector
on Openshift setting a specific annotation
(openshift.io/node-selector=) to prevent conflicts.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2055950

Signed-off-by: Simone Tiraboschi stirabos@redhat.com

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:

Opt-out from cluster-wide default node selector

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 1, 2022
@kubevirt-bot kubevirt-bot requested a review from sradco March 1, 2022 15:10
@coveralls
Copy link
Collaborator

coveralls commented Mar 1, 2022

Pull Request Test Coverage Report for Build 1969959500

  • 40 of 53 (75.47%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.004%) to 85.212%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controller/hyperconverged/hyperconverged_controller.go 0 1 0.0%
pkg/controller/operands/namespace.go 39 51 76.47%
Totals Coverage Status
Change from base Build 1957927795: -0.004%
Covered Lines: 3734
Relevant Lines: 4382

💛 - Coveralls

@tiraboschi
Copy link
Member Author

/retest

@tiraboschi tiraboschi force-pushed the namespace_node_selector branch 6 times, most recently from 17d85d7 to ff033d2 Compare March 2, 2022 16:39
@hco-bot
Copy link
Collaborator

hco-bot commented Mar 2, 2022

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-azure
hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-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 Mar 3, 2022

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

hco-e2e-upgrade-prev-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-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 Mar 4, 2022

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

@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-upgrade-prev-index-azure

In response to this:

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-azure
hco-e2e-upgrade-prev-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-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/test-infra repository.

@tiraboschi
Copy link
Member Author

/override-bot

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 4, 2022

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-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/test-infra repository.

Comment on lines 55 to 57
if found.Labels == nil {
found.Labels = make(map[string]string)
}
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't this be made outside the loop? Probably most of the time it would reduce the number of comparisons made.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines 69 to 71
if found.Annotations == nil {
found.Annotations = make(map[string]string)
}
Copy link
Member

Choose a reason for hiding this comment

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

same as above

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -96,6 +96,7 @@ var _ = Describe("HyperconvergedController", func() {
})

It("should ignore invalid requests", func() {
hcoNamespace := commonTestUtils.NewHcoNamespace()
Copy link
Member

Choose a reason for hiding this comment

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

This is done in many tests, couldn't this namespace be created only once and be reused in all of them?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

in pkg/controller/operands/operandHandler_test.go there's the same issue

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 4, 2022

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

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 10, 2022

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

@kubevirt-bot
Copy link
Contributor

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

In response to this:

okd-hco-e2e-image-index-aws lane succeeded.
/override ci/prow/okd-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.

@tiraboschi
Copy link
Member Author

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 10, 2022
@tiraboschi
Copy link
Member Author

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 11, 2022
The hyperconverged cluster operator defines
its own node selectors APIs that schedules
deployments and daemon sets on nodes according to
infra and workload classification.
Opting out from cluster-wide default node selector
on Openshift setting a specific annotation
(openshift.io/node-selector=) to prevent conflicts.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2055950

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Mar 11, 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

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 11, 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
hco-e2e-upgrade-prev-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-azure
okd-hco-e2e-image-index-aws lane succeeded.
/override ci/prow/okd-hco-e2e-image-index-gcp
hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-azure

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 11, 2022

hco-e2e-upgrade-prev-index-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-azure
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
hco-e2e-upgrade-prev-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-azure
okd-hco-e2e-image-index-aws lane succeeded.
/override ci/prow/okd-hco-e2e-image-index-gcp
hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-azure

@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, ci/prow/hco-e2e-upgrade-index-azure, ci/prow/hco-e2e-upgrade-prev-index-azure, ci/prow/hco-e2e-upgrade-prev-index-sno-azure, ci/prow/okd-hco-e2e-image-index-gcp

In response to this:

hco-e2e-upgrade-prev-index-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-azure
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
hco-e2e-upgrade-prev-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-azure
okd-hco-e2e-image-index-aws lane succeeded.
/override ci/prow/okd-hco-e2e-image-index-gcp
hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-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/test-infra repository.

@tiraboschi
Copy link
Member Author

/retest

@openshift-ci
Copy link

openshift-ci bot commented Mar 12, 2022

@tiraboschi: 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-azure 206327d link true /test hco-e2e-upgrade-index-azure
ci/prow/hco-e2e-image-index-gcp 206327d link true /test hco-e2e-image-index-gcp
ci/prow/okd-hco-e2e-image-index-gcp 206327d link true /test okd-hco-e2e-image-index-gcp
ci/prow/hco-e2e-image-index-azure 206327d link true /test hco-e2e-image-index-azure
ci/prow/hco-e2e-upgrade-prev-index-azure 206327d link true /test hco-e2e-upgrade-prev-index-azure
ci/prow/hco-e2e-upgrade-prev-index-sno-azure 206327d link false /test hco-e2e-upgrade-prev-index-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/test-infra repository. I understand the commands that are listed here.

@tiraboschi
Copy link
Member Author

/retest

@tiraboschi
Copy link
Member Author

/override coverage/coveralls
ignoring slightly decreased coverage

@kubevirt-bot
Copy link
Contributor

@tiraboschi: Overrode contexts on behalf of tiraboschi: coverage/coveralls

In response to this:

/override coverage/coveralls
ignoring slightly decreased coverage

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.

Comment on lines +55 to +73
if needUpdate {
if req.HCOTriggered {
req.Logger.Info("Updating existing namespace to new opinionated values")
} else {
req.Logger.Info("Reconciling an externally updated namespace to its opinionated values")
}
err := h.Client.Update(req.Ctx, found)
if err != nil {
if err != nil {
req.Logger.Error(err, "failed updating the namespace")
return &EnsureResult{
Err: err,
}
}
}
res.SetUpdated()
res.SetOverwritten(!req.HCOTriggered)
return res
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this condition and the needUpdate variable are not needed. it all can be placed in the previous condition. But we can fix it later.

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 13, 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 Mar 13, 2022
@kubevirt-bot kubevirt-bot merged commit a3f0dfc into kubevirt:main Mar 13, 2022
@tiraboschi
Copy link
Member Author

/cherry-pick release-1.6

@kubevirt-bot
Copy link
Contributor

@tiraboschi: #1799 failed to apply on top of branch "release-1.6":

Applying: Opt-out from cluster-wide default node selector
Using index info to reconstruct a base tree...
M	cmd/hyperconverged-cluster-operator/main.go
M	deploy/cluster_role.yaml
A	deploy/index-image/community-kubevirt-hyperconverged/1.7.0/manifests/kubevirt-hyperconverged-operator.v1.7.0.clusterserviceversion.yaml
A	deploy/olm-catalog/community-kubevirt-hyperconverged/1.7.0/manifests/kubevirt-hyperconverged-operator.v1.7.0.clusterserviceversion.yaml
M	pkg/components/components.go
M	pkg/controller/commonTestUtils/testUtils.go
M	pkg/controller/hyperconverged/hyperconverged_controller.go
M	pkg/controller/hyperconverged/hyperconverged_controller_test.go
M	pkg/controller/operands/operandHandler.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/operands/operandHandler.go
Auto-merging pkg/controller/hyperconverged/hyperconverged_controller_test.go
Auto-merging pkg/controller/hyperconverged/hyperconverged_controller.go
Auto-merging pkg/controller/commonTestUtils/testUtils.go
Auto-merging pkg/components/components.go
Auto-merging deploy/olm-catalog/community-kubevirt-hyperconverged/1.6.0/manifests/kubevirt-hyperconverged-operator.v1.6.0.clusterserviceversion.yaml
CONFLICT (content): Merge conflict in deploy/olm-catalog/community-kubevirt-hyperconverged/1.6.0/manifests/kubevirt-hyperconverged-operator.v1.6.0.clusterserviceversion.yaml
Auto-merging deploy/index-image/community-kubevirt-hyperconverged/1.6.0/manifests/kubevirt-hyperconverged-operator.v1.6.0.clusterserviceversion.yaml
Auto-merging deploy/cluster_role.yaml
Auto-merging cmd/hyperconverged-cluster-operator/main.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Opt-out from cluster-wide default node selector
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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.

tiraboschi added a commit to tiraboschi/hyperconverged-cluster-operator that referenced this pull request Mar 13, 2022
…rt#1799)

The hyperconverged cluster operator defines
its own node selectors APIs that schedules
deployments and daemon sets on nodes according to
infra and workload classification.
Opting out from cluster-wide default node selector
on Openshift setting a specific annotation
(openshift.io/node-selector=) to prevent conflicts.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2055950

This is a manual cherry-pick of kubevirt#1799

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request Mar 14, 2022
…#1816)

The hyperconverged cluster operator defines
its own node selectors APIs that schedules
deployments and daemon sets on nodes according to
infra and workload classification.
Opting out from cluster-wide default node selector
on Openshift setting a specific annotation
(openshift.io/node-selector=) to prevent conflicts.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2055950

This is a manual cherry-pick of #1799

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@tiraboschi tiraboschi deleted the namespace_node_selector branch April 1, 2022 15:58
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/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants