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 a discovery-client #15659
add a discovery-client #15659
Conversation
GCE e2e build/test failed for commit 02040694e21277b3b4c6421be5e5d95ec3cba8bb. |
Labelling this PR as size/L |
// It creates a RESTClient based on the passed in config, but it doesn't rely | ||
// on the Version, Codec, and Prefix of the config, because it uses AbsPath and | ||
// takes the raw response. | ||
func (d *DiscoveryClient) ServerAPIVersions() (groupVersions []string, err error) { |
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.
why wouldn't this just return an APIGroupList?
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.
Good point. I will let this function return APIGroupList and add a utility function that extracts groupVersions []string
I find the structure of this client a little confusing when I compare to all of our existing clients. I would expect to see an Interface first.
|
Sure, I will add the interfaces. |
|
||
// NewDiscovery creates a new DiscoveryClient for the given config. This client | ||
// can be used to discover supported resources in the API server. | ||
func NewDiscovery(c *Config) (*ExtensionsClient, error) { |
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.
Change return value :)
Also perhaps spell out the name, NewDiscoveryClient(...)
+1 to Derek's comments |
0204069
to
5a3215c
Compare
GCE e2e build/test failed for commit 5a3215c9d0151c662fa82ed109c646aea362b36e. |
5a3215c
to
ae6644c
Compare
GCE e2e build/test failed for commit ae6644cc87a17f696f365b1dfb66ec7076a90a5a. |
78f1854
to
6c6be50
Compare
@krousey this is ready. Could you take a look? Thanks. |
GCE e2e test build/test passed for commit 760ef0e1570e986f531bf84545eee7f8710ba4cd. |
GCE e2e test build/test passed for commit 78f18540ed5a028110f16d5cd0b943609e1035fb. |
GCE e2e test build/test passed for commit 6c6be50f2e9a64d47e584f61dde4b1f91af41753. |
} | ||
c.Invokes(action, nil) | ||
resource, found := c.Resources[groupVersion] | ||
if found { |
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 could just return c.Resources[groupVersion], nil
because the default value for a missing value will be nil.
GCE e2e test build/test passed for commit 0bded6dbf78820cbf545af38e4733b7e0dd98d7a. |
GCE e2e test build/test passed for commit 8ed323ad4cbbe4f9ea78e5d53fd4391e6f908700. |
323fb78
to
5859da3
Compare
GCE e2e test build/test passed for commit 323fb781e96a9cab8ff61d86564fc60ff2fef505. |
PR changed after LGTM, removing LGTM. |
add back lgtm as it's a squash |
GCE e2e test build/test passed for commit 5859da3. |
The second build of Shippable does not begin in the entire afternoon... |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 5859da3. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
@smarterclayton's comment: #15808 (comment)
|
return d.httpClient.Do(req) | ||
} | ||
|
||
// APIGroups returns the supported groups, with information like supported versions and the |
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.
Is APIGroups the function name? Many of the comments in this file contains incorrect function name.
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.
Thanks. I submitted a commit to fix these, I guess the commit is lost during the squash. I'll submit a patch.
…#15659-upstream-release-1.1 Auto commit by PR queue bot
…y-pick-of-#15659-upstream-release-1.1 Auto commit by PR queue bot
…y-pick-of-#15659-upstream-release-1.1 Auto commit by PR queue bot
@lavalamp This is still WIP, it'd be great if you can check if this is in the right direction.
The SupportedResources() functions are copied from Brendan's #15427.