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

expose discovery information on scalable resources #51703

Merged
merged 1 commit into from
Sep 3, 2017

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Aug 31, 2017

Builds on #49971 and provides the GroupVersion information that can be used by a dynamic scale client.

@kubernetes/sig-api-machinery-pr-reviews
@foxish @DirectXMan12 since you both asked for it.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 31, 2017
@k8s-github-robot k8s-github-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Aug 31, 2017
@deads2k deads2k force-pushed the discovery-02-scale branch from a4d3d5e to 465f02d Compare August 31, 2017 14:58
@deads2k
Copy link
Contributor Author

deads2k commented Aug 31, 2017

/retest

@lavalamp
Copy link
Member

Haven't looked in detail but I agree in theory.

@@ -778,6 +778,12 @@ type APIResource struct {
SingularName string `json:"singularName" protobuf:"bytes,6,opt,name=singularName"`
// namespaced indicates if a resource is namespaced or not.
Namespaced bool `json:"namespaced" protobuf:"varint,2,opt,name=namespaced"`
// group is the preferred group of the resource. Empty implies the group of the containing resource list.
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove the extra space after the period? There are many occurrences. Is it an editor issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you remove the extra space after the period? There are many occurrences. Is it an editor issue?

MLA when I was growing up I'm afraid.

Copy link
Member

Choose a reason for hiding this comment

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

One mystery solved :-)

@caesarxuchao
Copy link
Member

A nit, otherwise lgtm.

@smarterclayton
Copy link
Contributor

/approve

Based on reviewer comments and general agreement, plus API is consistent with others

@deads2k deads2k added this to the v1.8 milestone Sep 1, 2017
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 1, 2017
@deads2k
Copy link
Contributor Author

deads2k commented Sep 1, 2017

/approve no-issue

@deads2k deads2k added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 1, 2017
@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2017
@deads2k
Copy link
Contributor Author

deads2k commented Sep 1, 2017

/retest

gvk := gvkProvider.GroupVersionKind()
apiResource.Group = gvk.Group
apiResource.Version = gvk.Version
apiResource.Kind = gvk.Kind
Copy link
Contributor

Choose a reason for hiding this comment

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

Now we have a KindProvider and a GroupVersionKindProvider provider. Wouldn't it make things clearer to have a GroupVersionProvider to complement the KindProvider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now we have a KindProvider and a GroupVersionKindProvider provider. Wouldn't it make things clearer to have a GroupVersionProvider to complement the KindProvider?

The other is for federation, I'd rather not change it for 1.8 since the intent is different.

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean with federation? Compare https://github.com/deads2k/kubernetes/blob/7b44627d0372a3febbe906441c28f43323760bf9/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go#L374. Isn't that the source of a custom kind? Your interface does gv in addition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean with federation? Compare https://github.com/deads2k/kubernetes/blob/7b44627d0372a3febbe906441c28f43323760bf9/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go#L374. Isn't that the source of a custom kind? Your interface does gv in addition.

It's only implemented by federation types to lie about their kinds during discovery. Every interaction with federation reveals dragons that I'd prefer to slay early in 1.9 as opposed to late in 1.8.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ic, then just add a comment to your new interface that it trumps over the KindProvider. After that lgtm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ic, then just add a comment to your new interface that it trumps over the KindProvider. After that lgtm.

done

@deads2k
Copy link
Contributor Author

deads2k commented Sep 1, 2017

/retest

@sttts
Copy link
Contributor

sttts commented Sep 1, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 1, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, smarterclayton, sttts

Associated issue requirement bypassed by: deads2k

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@deads2k
Copy link
Contributor Author

deads2k commented Sep 1, 2017

/retest

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 50602, 51561, 51703, 51748, 49142)

@k8s-github-robot k8s-github-robot merged commit 1d43050 into kubernetes:master Sep 3, 2017
@deads2k deads2k deleted the discovery-02-scale branch July 3, 2018 18:01
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. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants