Skip to content

✨Operator support MultipleHubs. #524

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

Conversation

xuezhaojun
Copy link
Member

@xuezhaojun xuezhaojun commented Jun 16, 2024

Summary

The PR is to support MultiHubs also in the operator.

The PR is related to: #443


Some conversations that need highlight:

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 79.16667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 62.40%. Comparing base (a14450a) to head (7b61bec).
Report is 1 commits behind head on main.

Files Patch % Lines
...lers/klusterletcontroller/klusterlet_controller.go 46.15% 6 Missing and 1 partial ⚠️
...llers/ssarcontroller/klusterlet_ssar_controller.go 87.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #524      +/-   ##
==========================================
- Coverage   62.44%   62.40%   -0.05%     
==========================================
  Files         138      138              
  Lines       11610    11605       -5     
==========================================
- Hits         7250     7242       -8     
- Misses       3593     3597       +4     
+ Partials      767      766       -1     
Flag Coverage Δ
unit 62.40% <79.16%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xuezhaojun xuezhaojun force-pushed the operator-switch-hub-support branch 2 times, most recently from 25658c2 to 050ace2 Compare June 24, 2024 06:22
@xuezhaojun xuezhaojun changed the title [WIP] ✨Operator support MultipleHubs. ✨Operator support MultipleHubs. Jun 24, 2024
@xuezhaojun xuezhaojun force-pushed the operator-switch-hub-support branch 2 times, most recently from a79bafb to b7a249c Compare June 24, 2024 08:45
@xuezhaojun
Copy link
Member Author

/assign @qiujian16

@xuezhaojun xuezhaojun force-pushed the operator-switch-hub-support branch from b7a249c to 2526772 Compare June 24, 2024 09:10
@xuezhaojun xuezhaojun closed this Jun 24, 2024
@xuezhaojun xuezhaojun reopened this Jun 24, 2024
@xuezhaojun xuezhaojun closed this Jun 24, 2024
@xuezhaojun xuezhaojun reopened this Jun 24, 2024
@xuezhaojun
Copy link
Member Author

/assign @elgnay

// TODO: @xuezhaojun after the agent switch to the hub2, the 'managedcluster' on the hub1 keep showing `Available` status
// This is because:
// * the lease contoller only watch managedcluster resource, no periodical check on the managedcluster lease
// * if the `hubAcceptsClient` is false, the controller will skip the reconciliation
Copy link
Member

Choose a reason for hiding this comment

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

this looks like a bug cc @elgnay

Copy link
Contributor

Choose a reason for hiding this comment

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

  • the lease contoller only watch managedcluster resource

The lease contoller watches both the managedcluster and the lease;

  • the lease contoller only watch managedcluster resource, no periodical check on the managedcluster lease

The the managed cluster will be requeued after LeaseDurationSeconds.

  • if the hubAcceptsClient is false, the controller will skip the reconciliation

That's true. The current logic of the controller does not handle hubAcceptsClient==false very well. Some other controllers may have the similar issue.

@xuezhaojun xuezhaojun requested a review from qiujian16 June 25, 2024 01:07
@xuezhaojun xuezhaojun force-pushed the operator-switch-hub-support branch 2 times, most recently from ab0c3e3 to 65874b1 Compare June 25, 2024 06:59
@xuezhaojun
Copy link
Member Author

@qiujian16 The e2e part is removed and will join the refactor PR, the intergration test added, please take another look, thanks!

@xuezhaojun xuezhaojun force-pushed the operator-switch-hub-support branch 6 times, most recently from 929feaf to 5d8b3d9 Compare June 25, 2024 08:29
@xuezhaojun xuezhaojun force-pushed the operator-switch-hub-support branch 6 times, most recently from 5b21bb6 to ee00f8d Compare June 25, 2024 13:05
@xuezhaojun xuezhaojun closed this Jun 25, 2024
@xuezhaojun xuezhaojun reopened this Jun 25, 2024
@xuezhaojun xuezhaojun closed this Jun 26, 2024
@xuezhaojun xuezhaojun reopened this Jun 26, 2024
@xuezhaojun xuezhaojun closed this Jun 26, 2024
@xuezhaojun xuezhaojun reopened this Jun 26, 2024
@xuezhaojun xuezhaojun closed this Jun 26, 2024
@xuezhaojun xuezhaojun reopened this Jun 26, 2024
@xuezhaojun xuezhaojun force-pushed the operator-switch-hub-support branch 3 times, most recently from 4502439 to 5e68514 Compare June 27, 2024 03:10
@xuezhaojun xuezhaojun force-pushed the operator-switch-hub-support branch from 5e68514 to 7b61bec Compare June 27, 2024 03:13
@qiujian16
Copy link
Member

/approve

Copy link
Contributor

openshift-ci bot commented Jun 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16, xuezhaojun

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

@xuezhaojun xuezhaojun requested a review from elgnay June 27, 2024 03:55
@xuezhaojun xuezhaojun closed this Jun 27, 2024
@xuezhaojun xuezhaojun reopened this Jun 27, 2024
@qiujian16
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jun 27, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 5a747e8 into open-cluster-management-io:main Jun 27, 2024
23 of 24 checks passed
@xuezhaojun xuezhaojun deleted the operator-switch-hub-support branch June 27, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants