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

finish new dynamic client and deprecate old dynamic client #63446

Merged
merged 4 commits into from May 11, 2018

Conversation

@deads2k
Contributor

deads2k commented May 4, 2018

Builds on a couple other pulls. This completes the transition to the new dynamic client.

@kubernetes/sig-api-machinery-pr-reviews
@caesarxuchao @sttts

The old dynamic client has been replaced by a new one.  The previous dynamic client will exist for one release in `client-go/deprecated-dynamic`.  Switch as soon as possible.
@deads2k

This comment has been minimized.

Contributor

deads2k commented May 4, 2018

/hold

just holding so we don't merge this without twiddling qps on the GC controller.

@caesarxuchao

This comment has been minimized.

Member

caesarxuchao commented May 8, 2018

Can we leave the old dynamic client interface there for one quarter, and give people a deprecation notice? With a quick search, there are quite a few users: https://github.com/search?p=1&q=%22dynamic.newclient%22&type=Code&utf8=%E2%9C%93

@caesarxuchao

This comment has been minimized.

Member

caesarxuchao commented May 8, 2018

Discussed with deads2k offline, we'll move the old dynamic client to client-go/deprecated-dynamic and keep it for a quarter.

@deads2k

This comment has been minimized.

Contributor

deads2k commented May 9, 2018

Discussed with deads2k offline, we'll move the old dynamic client to client-go/deprecated-dynamic and keep it for a quarter.

done, release note added.

@@ -60,7 +60,7 @@ const ResourceResyncTime time.Duration = 0
// up to date as the notification is sent.
type GarbageCollector struct {
restMapper resettableRESTMapper
dynamicClient dynamic.DynamicInterface
dynamicClient dynamic.Interface

This comment has been minimized.

@sttts

sttts May 9, 2018

Contributor

we should have kept the interface name. Would have made this easier. Maybe we can restore it in a follow-up?

This comment has been minimized.

@deads2k

deads2k May 9, 2018

Contributor

we should have kept the interface name. Would have made this easier. Maybe we can restore it in a follow-up?

This actually is the "old" interface name. Interface is the name used by the primary dynamic interface. GC was updated to use the new before the new became primary.

This comment has been minimized.

@sttts

sttts May 11, 2018

Contributor

👍 now with multiple commits this is even visible :)

@deads2k deads2k changed the title from remove old dynamic client to finish new dynamic client and deprecate old dynamic client May 9, 2018

)
// dynamicCodec is a codec that wraps the standard unstructured codec
// with special handling for Status objects.

This comment has been minimized.

@sttts

sttts May 9, 2018

Contributor

is this old code?!

This comment has been minimized.

@deads2k

deads2k May 9, 2018

Contributor

is this old code?!

Yeah, moved to point of use.

@deads2k

This comment has been minimized.

Contributor

deads2k commented May 9, 2018

@sttts split commits as requested.

func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions) error {
_, err := c.client.Fake.
Invokes(testing.NewDeleteAction(c.resource, c.namespace, name), &metav1.Status{Status: "dynamic delete fail"})
func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions, subresources ...string) error {

This comment has been minimized.

@sttts

sttts May 9, 2018

Contributor

out of curiosity: do we have subresource deletion anywhere?

This comment has been minimized.

@deads2k

deads2k May 9, 2018

Contributor

out of curiosity: do we have subresource deletion anywhere?

it's logically possible. nothing immediately comes to mind though.

@enisoc enisoc referenced this pull request May 9, 2018

Closed

Switch to new dynamic client #47

@deads2k

This comment has been minimized.

Contributor

deads2k commented May 10, 2018

@sttts @caesarxuchao's concern was addressed and the commits are split for review now. Review and I'll rebase?

@sttts

This comment has been minimized.

Contributor

sttts commented May 11, 2018

/approve
lgtm

Needs a rebase.

@deads2k

This comment has been minimized.

Contributor

deads2k commented May 11, 2018

/retest

@deads2k deads2k added the lgtm label May 11, 2018

@deads2k

This comment has been minimized.

Contributor

deads2k commented May 11, 2018

approval is for new client-go package that chao and I agreed on. We own the sub-piece. approving.

@deads2k deads2k added the approved label May 11, 2018

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented May 11, 2018

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

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

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-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented May 11, 2018

Automatic merge from submit-queue (batch tested with PRs 63367, 63718, 63446, 63723, 63720). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-merge-robot k8s-merge-robot merged commit 92ba95c into kubernetes:master May 11, 2018

16 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation deads2k authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
@caesarxuchao

lgtm. Sorry I can't get to this earlier.

)
// NewDiscoveryRESTMapper returns a RESTMapper based on discovery information.
func NewDiscoveryRESTMapper(resources []*metav1.APIResourceList) (*meta.DefaultRESTMapper, error) {

This comment has been minimized.

@caesarxuchao

caesarxuchao May 12, 2018

Member

So deprecated-dynamic doesn't have all the interfaces the "old" dynamic client had. I think removing this one is ok, a search on github doesn't show any real use case.

@deads2k deads2k deleted the deads2k:client-08-remove-old branch Jul 3, 2018

wking added a commit to wking/openshift-installer that referenced this pull request Aug 1, 2018

tests/smoke/cluster_test: Get kubectl resource from genericclioptions
This change is similar to kubernetes/kubernetes@fd044d1 (fix dynamic
client name, 2018-05-09, kubernetes/kubernetes#63446, v1.11.0-beta.0)
and it protects us from the eventual removal of
k8s.io/kubernetes/pkg/kubectl/resource in
kubernetes/kubernetes@16d6a6c (move resource builder to generic
options, 2018-05-10, kubernetes/kubernetes#63669, v1.11.0-beta.0).

wking added a commit to wking/openshift-installer that referenced this pull request Aug 1, 2018

tests/smoke/cluster_test: Get kubectl resource from genericclioptions
This change is similar to kubernetes/kubernetes@fd044d1 (fix dynamic
client name, 2018-05-09, kubernetes/kubernetes#63446, v1.11.0-beta.0)
and it protects us from the eventual removal of
k8s.io/kubernetes/pkg/kubectl/resource in
kubernetes/kubernetes@16d6a6c (move resource builder to generic
options, 2018-05-10, kubernetes/kubernetes#63669, v1.11.0-beta.0).

wking added a commit to wking/openshift-installer that referenced this pull request Aug 2, 2018

tests/smoke/cluster_test: Get kubectl resource from genericclioptions
This change is similar to kubernetes/kubernetes@fd044d1 (fix dynamic
client name, 2018-05-09, kubernetes/kubernetes#63446, v1.11.0-beta.0)
and it protects us from the eventual removal of
k8s.io/kubernetes/pkg/kubectl/resource in
kubernetes/kubernetes@16d6a6c (move resource builder to generic
options, 2018-05-10, kubernetes/kubernetes#63669, v1.11.0-beta.0).

wking added a commit to wking/openshift-installer that referenced this pull request Aug 3, 2018

tests/smoke/cluster_test: Get kubectl resource from genericclioptions
This change is similar to kubernetes/kubernetes@fd044d1 (fix dynamic
client name, 2018-05-09, kubernetes/kubernetes#63446, v1.11.0-beta.0)
and it protects us from the eventual removal of
k8s.io/kubernetes/pkg/kubectl/resource in
kubernetes/kubernetes@16d6a6c (move resource builder to generic
options, 2018-05-10, kubernetes/kubernetes#63669, v1.11.0-beta.0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment