-
Notifications
You must be signed in to change notification settings - Fork 267
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
Initial model adapter controller implementation #32
Conversation
ca2c1ea
to
5697c2e
Compare
@@ -41,27 +70,64 @@ func Add(mgr manager.Manager) error { | |||
|
|||
// newReconciler returns a new reconcile.Reconciler | |||
func newReconciler(mgr manager.Manager) (reconcile.Reconciler, error) { | |||
cacher := mgr.GetCache() | |||
|
|||
podInformer, err := cacher.GetInformer(context.TODO(), &corev1.Pod{}) |
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.
We can do this but it will be difficult to write unit tests later. I am ok, with adding a TODO for later or you can add them function arguments.
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.
There is no business logic in this fuction, so we dont need to write unit test for it. Ignore the previous comment.
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.
I considered to use informer here directly but currently use the high level interface. may do some refactor later here. so this is indeed not being used yet.
} | ||
|
||
err := r.Get(ctx, objectKey, svc) | ||
if err == nil { |
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.
you can remove the err == nil check.
Just one is if errors.IsNotFound() {}
is enough.
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.
make sense. Let me update the logic here.
@varungup90 feedback addressed. |
* Add initial implementation of model adapter controller * Update adapter pod lists * Finish initial integration tests * Address review feedback
Address #31 and part of #22
DO NOT MERGE it until #27 is merged and I will rebase the code and update this PR