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

Initial model adapter controller implementation #32

Merged
merged 4 commits into from
Jul 19, 2024

Conversation

Jeffwan
Copy link
Collaborator

@Jeffwan Jeffwan commented Jul 14, 2024

Address #31 and part of #22

DO NOT MERGE it until #27 is merged and I will rebase the code and update this PR

@Jeffwan Jeffwan changed the title Initial model adapter controller implementation [WIP] Initial model adapter controller implementation Jul 14, 2024
@Jeffwan Jeffwan force-pushed the jiaxin/model-adapter-controller-implementation branch from ca2c1ea to 5697c2e Compare July 15, 2024 22:49
@@ -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{})
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator Author

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 {
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@Jeffwan Jeffwan changed the title [WIP] Initial model adapter controller implementation Initial model adapter controller implementation Jul 19, 2024
@Jeffwan
Copy link
Collaborator Author

Jeffwan commented Jul 19, 2024

@varungup90 feedback addressed.

@Jeffwan Jeffwan merged commit 5b368c6 into main Jul 19, 2024
@Jeffwan Jeffwan deleted the jiaxin/model-adapter-controller-implementation branch July 19, 2024 20:47
gangmuk pushed a commit that referenced this pull request Jan 25, 2025
* Add initial implementation of model adapter controller

* Update adapter pod lists

* Finish initial integration tests

* Address review feedback
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