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

Update vs/vsr status when IC becomes the leader #996

Merged
merged 5 commits into from
Jun 24, 2020
Merged

Conversation

Rulox
Copy link
Contributor

@Rulox Rulox commented Jun 17, 2020

Proposed changes

When updating VS and VSR statuses of created resources during a leading election process, those resources won't have their status updated until they're synced again and the KIC instance has become the leader.

With this change, KIC will trigger an update of all VS/VSR statuses based on their last event when the KIC becomes the leader.

@Rulox Rulox added the bug An issue reporting a potential bug label Jun 17, 2020
@Rulox Rulox self-assigned this Jun 17, 2020
internal/k8s/controller.go Outdated Show resolved Hide resolved
@Rulox Rulox force-pushed the fix-leader-status branch from 22cfb37 to bca598a Compare June 19, 2020 10:47
internal/k8s/controller.go Outdated Show resolved Hide resolved
internal/k8s/controller.go Outdated Show resolved Hide resolved
internal/k8s/controller.go Outdated Show resolved Hide resolved
internal/k8s/controller.go Show resolved Hide resolved
@Rulox Rulox requested a review from pleshakov June 22, 2020 14:07
@Rulox
Copy link
Contributor Author

Rulox commented Jun 22, 2020

I've implemented your suggestions @pleshakov @LorcanMcVeigh let me know your thoughts, thanks

Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

@Rulox thanks for the updates.

The new code doesn't compile ;) Could you fix that?

There is another bug. Unfortunately, I didn't see it during the first review :(
In OnStartedLeading handler before you call updateVirtualServersStatusFromEvents or updateVirtualServerRoutessStatusFromEvents, you need to check if lbc.areCustomResourcesEnabled is set. Otherwise, the code like this lbc.virtualServerRouteLister.List() will result into panic: runtime error: invalid memory address or nil pointer dereference

internal/k8s/controller.go Outdated Show resolved Hide resolved
internal/k8s/controller.go Show resolved Hide resolved
internal/k8s/controller.go Outdated Show resolved Hide resolved
@Rulox Rulox requested a review from pleshakov June 23, 2020 10:30
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

🚀

internal/k8s/controller.go Show resolved Hide resolved
@Rulox Rulox merged commit 70ad990 into master Jun 24, 2020
@Rulox Rulox deleted the fix-leader-status branch June 24, 2020 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue reporting a potential bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants