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

controlplane/control: Introduce peer manager #361

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

orozery
Copy link
Collaborator

@orozery orozery commented Feb 29, 2024

This PR adds the peerManager which is responsible for monitoring peers, and updating peer status (reachable or not).

@orozery orozery force-pushed the peer-manager branch 3 times, most recently from 6565b83 to b41c772 Compare February 29, 2024 06:45
@orozery orozery linked an issue Feb 29, 2024 that may be closed by this pull request
@orozery orozery requested a review from kfirtoledo February 29, 2024 07:20
pkg/controlplane/control/peer.go Show resolved Hide resolved
meta.SetStatusCondition(&m.pr.Status.Conditions, reachableCond)
m.lock.Unlock()

m.statusCallback(m.pr)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a comment why you call the callback

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure (it's for non-CRD mode, which does not watch Peer status).

}

// Start the peer manager.
func (m *peerManager) Start() error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where do you call this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's called by the runnable manager, which subscribes here:

runnableManager.Add(controlManager)

This commit adds the peerManager which is responsible for monitoring peers,
and updating peer status (reachable or not).

Signed-off-by: Or Ozeri <[email protected]>
@orozery orozery merged commit 9f23c04 into clusterlink-net:main Mar 5, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add status to Peers in CRD-mode
2 participants