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

Add context and options to scale client #88599

Merged
merged 1 commit into from Mar 6, 2020

Conversation

@julianvmodesto
Copy link
Contributor

julianvmodesto commented Feb 26, 2020

What type of PR is this?

/kind feature

What this PR does / why we need it:

This change adds context and options to the client-go scale client. It's not generated.

Which issue(s) this PR fixes:

Part of https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20200123-client-go-ctx.md

#88274

Special notes for your reviewer:

I think we may want to snapshot this first like for k8s.io/client-go/kubernetes => k8s.io/client-go/deprecated?

Does this PR introduce a user-facing change?:

Signatures on scale client methods have been modified to accept `context.Context` as a first argument. Signatures of Get, Update, and Patch methods have been updated to accept GetOptions, UpdateOptions and PatchOptions respectively.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20200123-client-go-ctx.md
@fedebongio

This comment has been minimized.

Copy link
Contributor

fedebongio commented Feb 27, 2020

@@ -34,11 +36,11 @@ type ScalesGetter interface {
// the scale subresource.
type ScaleInterface interface {
// Get fetches the scale of the given scalable resource.
Get(resource schema.GroupResource, name string) (*autoscalingapi.Scale, error)
Get(ctx context.Context, resource schema.GroupResource, name string, opts v1.GetOptions) (*autoscalingapi.Scale, error)

This comment has been minimized.

Copy link
@mikedanese

mikedanese Feb 28, 2020

Member

Are the options ever going to be used here or are they always going to be empty?

This comment has been minimized.

Copy link
@julianvmodesto

julianvmodesto Feb 29, 2020

Author Contributor

Ah likely empty since GetOptions aren’t currently useful. I included them only for consistency.

This comment has been minimized.

Copy link
@mikedanese

mikedanese Mar 6, 2020

Member

Consistency makes sense given that they may be useful in the future.

@mikedanese

This comment has been minimized.

Copy link
Member

mikedanese commented Feb 28, 2020

Seems reasonable.

@julianvmodesto

This comment has been minimized.

Copy link
Contributor Author

julianvmodesto commented Feb 29, 2020

Hm I need to fix the tests...

@julianvmodesto julianvmodesto force-pushed the julianvmodesto:scale-ctx-opts branch from 11ba622 to bb22e8c Mar 2, 2020
@julianvmodesto julianvmodesto force-pushed the julianvmodesto:scale-ctx-opts branch from bb22e8c to da3c343 Mar 2, 2020
@julianvmodesto julianvmodesto changed the title [WIP] Add context and options to scale client Add context and options to scale client Mar 2, 2020
@julianvmodesto

This comment has been minimized.

Copy link
Contributor Author

julianvmodesto commented Mar 2, 2020

Okay, fixed

@julianvmodesto

This comment has been minimized.

Copy link
Contributor Author

julianvmodesto commented Mar 4, 2020

/retest

PTAL @mikedanese

@liggitt liggitt assigned liggitt and unassigned deads2k Mar 6, 2020
@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Mar 6, 2020

/assign
/milestone v1.18
/hold for exception request https://groups.google.com/forum/#!topic/kubernetes-sig-release/0Vl7My_ElgY

@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Mar 6, 2020
@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Mar 6, 2020

/priority important-soon

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Mar 6, 2020

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label Mar 6, 2020
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Mar 6, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: julianvmodesto, liggitt

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

@mikedanese

This comment has been minimized.

Copy link
Member

mikedanese commented Mar 6, 2020

/lgtm

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Mar 6, 2020

/hold cancel

Exception approved

@k8s-ci-robot k8s-ci-robot merged commit 179fe40 into kubernetes:master Mar 6, 2020
12 of 16 checks passed
12 of 16 checks passed
pull-kubernetes-e2e-gce Job triggered.
Details
pull-kubernetes-e2e-gce-100-performance Job triggered.
Details
pull-kubernetes-kubemark-e2e-gce-big Job triggered.
Details
pull-kubernetes-verify Job triggered.
Details
cla/linuxfoundation julianvmodesto authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-kind Job succeeded.
Details
pull-kubernetes-e2e-kind-ipv6 Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.