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

Add Reconciler #184

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sthwang-metal
Copy link
Contributor

@sthwang-metal sthwang-metal commented Jun 19, 2024

Summary of Changes

This PR adds the reconciler that will fix out of sync resources by deleting extra namespaces/loadbalancers and create missing namespaces/loadbalancers.

Some design decisions:

  • convert from having a task channel per lb to one task channel because otherwise would need some kind of mutex around the channels (ie. what if the reconciler both try to add a channel for a newly created lb?)
  • the reconcile action lives as a goroutine in the process command so that the task channel can be shared between the main process and reconcile task

Note: will add some tests and wont merge this till I do

Note: go.mod is pointing load-balancer-api to my fork but will change it once this gets merged and released: infratographer/load-balancer-api#353

@sthwang-metal sthwang-metal requested review from a team as code owners June 19, 2024 08:54
@sthwang-metal sthwang-metal force-pushed the sthwang/add-reconciler branch from 01e01f3 to c6ee620 Compare June 19, 2024 08:55
Signed-off-by: Stephen Hwang <[email protected]>
@sthwang-metal sthwang-metal force-pushed the sthwang/add-reconciler branch 6 times, most recently from 2bde102 to 4866565 Compare June 19, 2024 16:49
Signed-off-by: Stephen Hwang <[email protected]>
@sthwang-metal sthwang-metal force-pushed the sthwang/add-reconciler branch from 4866565 to a3f78e4 Compare June 19, 2024 17:10
@sthwang-metal sthwang-metal force-pushed the sthwang/add-reconciler branch from f0b85a7 to 808707c Compare July 8, 2024 19:14
Signed-off-by: Stephen Hwang <[email protected]>
@sthwang-metal sthwang-metal force-pushed the sthwang/add-reconciler branch from 808707c to 609f488 Compare July 8, 2024 19:14
return errMissingReconcilerInterval
}

ticker := time.NewTicker(interval)
Copy link
Contributor

Choose a reason for hiding this comment

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

you'll wanna add a defer ticker.Stop()? to cleanup before exit

@sthwang-metal sthwang-metal marked this pull request as draft December 23, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants