-
Notifications
You must be signed in to change notification settings - Fork 63
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
Migrate to reconciliation loop using controller-runtime #208
Merged
samuelattwood
merged 10 commits into
nats-io:feature/controller-runtime
from
aqube:controller-runtime
Dec 9, 2024
Merged
Migrate to reconciliation loop using controller-runtime #208
samuelattwood
merged 10 commits into
nats-io:feature/controller-runtime
from
aqube:controller-runtime
Dec 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Removes the kubeconfig flag and instead uses ctrl.RegisterFlags(fs) and ctrl.GetConfig(). The controller-runtime currently registers the kubeconfig flag, which lead to a redefined flag error when registering it again.
This is based on the Makefile of an operator-sdk based project.
Controllers and tests are based on files generated by operator-sdk. Adds a minimal test suite for the controllers with a etcd test env and a test nats jetStream server to test against.
samuelattwood
approved these changes
Dec 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP - Approved to merge to feature branch
samuelattwood
merged commit Dec 9, 2024
42f8cfe
into
nats-io:feature/controller-runtime
2 of 3 checks passed
samuelattwood
pushed a commit
that referenced
this pull request
Dec 9, 2024
* Setup optional controller-runtime manager in main Removes the kubeconfig flag and instead uses ctrl.RegisterFlags(fs) and ctrl.GetConfig(). The controller-runtime currently registers the kubeconfig flag, which lead to a redefined flag error when registering it again. * Add update permissions for resource finalizers * Add envtest to Makefile This is based on the Makefile of an operator-sdk based project. * Update test to include envtest and run the internal/controller test suite * Add account, consumer and stream controller stubs to be implemented Controllers and tests are based on files generated by operator-sdk. Adds a minimal test suite for the controllers with a etcd test env and a test nats jetStream server to test against. * Add logs to Reconcile functions * Add internal/controller to jetstreamSrc * Register account, consumer and stream reconcilers * Add jsClient to test suit variables * Remove format from log string
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on the
sattwood/codegen_update
branch. Once it gets merged, this branch can be rebased onto main. (Diff without those changes)This adds the foundation to migrate to a full control-loop using the controller-runtime.
Adds a config flag
control-loop
to use the alternative implementation. Setting this flag to true executesrunControlLoop
instead of the regular main function.Adds empty controllers for accounts, consumers and streams in
internal/controller
. These come with a test suite with an envtest control-plane and a jetStream server to test against. TheReconcile
functions of these controllers need to be implemented to add functionality.Updates the rbac.yml to include the
update
permission for thestreams/finalizers
,consumers/finalizers
andaccounts/finalizers
resources.