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

✨ adding APIReader to the manager and injection. #327

Conversation

shawn-hurley
Copy link

Adding the APIReader onto the manager and allowing users to use dependency injection to add this to their types.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 13, 2019
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 13, 2019
Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

I am seeing more requests for talking to API server directly, so thanks for taking this up. I have a few questions.

@@ -61,6 +61,9 @@ type controllerManager struct {
// client is the client injected into Controllers (and EventHandlers, Sources and Predicates).
client client.Client

// apiReader is the reader that will make requests to the api server and not the cache.
apiReader client.Reader
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for not making it client.Client ? [implementation wise client.Client is already supported]. Though it does get tricky with the naming if we decide to change the type here apiClient ? maybe directClient ?

Copy link
Author

Choose a reason for hiding this comment

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

My thought process was

  1. When you need this field you really only need the reader. This still points people to the client for most use cases. I was hoping the fact it did not have any write mechanisms people would only use this when they needed it.

  2. Naming is the other reason. I think the idea that we don't really expose "direct" vs "cache" and try to hide this decision as much as possible is a good thing. This is just a step in adding an escape hatch but not exposing that decision still.

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

those reasons @shawn-hurley make a lot of sense -- +1: from me to having it be a Reader.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for delayed response. Haven't come across write use case, so going with the restricted use-case sounds good.

@shawn-hurley shawn-hurley force-pushed the feature/api-reader-on-manager branch from 7fdbe94 to 531b7e0 Compare March 5, 2019 18:17
@droot droot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 7, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: shawn-hurley

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 06eceeb into kubernetes-sigs:master Mar 7, 2019
@shawn-hurley shawn-hurley mentioned this pull request Mar 13, 2019
DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
fixed gopkg.toml lookup code in vendor update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants