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: connect enable/disable peer to heartbeat #178

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

kfirtoledo
Copy link
Collaborator

Update peer status in policy-engine according to the heartbeat status.

pkg/controlplane/client.go Outdated Show resolved Hide resolved
pkg/controlplane/instance.go Outdated Show resolved Hide resolved
pkg/controlplane/instance.go Outdated Show resolved Hide resolved
pkg/controlplane/client.go Outdated Show resolved Hide resolved
pkg/controlplane/client.go Outdated Show resolved Hide resolved
Comment on lines 119 to 122
{
activePrevState = c.active
c.active = active
if active || c.lastSeen.IsZero() {
c.lastSeen = time.Now()
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{
activePrevState = c.active
c.active = active
if active || c.lastSeen.IsZero() {
c.lastSeen = time.Now()
}
}
activePrevState := c.active
c.active = active
if active || c.lastSeen.IsZero() {
c.lastSeen = time.Now()
}

And remove var activePrevState bool

@kfirtoledo kfirtoledo merged commit 3b17367 into clusterlink-net:main Nov 13, 2023
@kfirtoledo kfirtoledo deleted the peer branch November 13, 2023 09:33
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.

3 participants