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

Move cached discovery clients to their own packages #72214

Merged
merged 4 commits into from
Feb 14, 2019

Conversation

caesarxuchao
Copy link
Member

@caesarxuchao caesarxuchao commented Dec 19, 2018

Fix #68854.

This pull tries to rearrange the discovery clients in a more logical way.

[update] a good by-product is the removal of a few vendored packages from the staging repositories.

Breaking changes in client-go:
The disk-cached discovery client is moved from k8s.io/client-go/discovery to k8s.io/client-go/discovery/cached/disk.
The memory-cached discovery client is moved from k8s.io/client-go/discovery/cached to k8s.io/client-go/discovery/cached/memory.

/sig api-machinery
/kind cleanup
/assign @liggitt @mborsz

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Dec 19, 2018
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Dec 19, 2018
@k8s-ci-robot k8s-ci-robot requested review from enj and gmarek December 19, 2018 22:01
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 20, 2018
@mborsz
Copy link
Member

mborsz commented Dec 21, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 21, 2018
@caesarxuchao
Copy link
Member Author

@liggitt could you help approve the change? Thanks.

@liggitt
Copy link
Member

liggitt commented Dec 30, 2018

this is a nicer structure, but I have mixed feelings about whether the external churn for callers is worth the change. do we have a good sense for the amount of direct usage these have and what the impact on client-go users would be?

cc @kubernetes/sig-api-machinery-pr-reviews

@caesarxuchao
Copy link
Member Author

caesarxuchao commented Jan 3, 2019

If we trust the google search engine, there are not many imports.

Less than 20 results for the memcached one.

2 results for the disk cached one.

I tried github code search as well, but it doesn't support exact match.

I can send a breaking change waring to the kubernetes-dev mailing list if that helps move this forward.

@liggitt
Copy link
Member

liggitt commented Jan 4, 2019

seems reasonable, would like a second ack from @kubernetes/sig-api-machinery-pr-reviews

/assign @deads2k

@caesarxuchao
Copy link
Member Author

Gentle ping @deads2k

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 13, 2019
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 12, 2019
@caesarxuchao
Copy link
Member Author

/retest

@lavalamp
Copy link
Member

The structure is much nicer. Can you leave type aliases behind so as to not break people? https://golang.org/doc/go1.9#language

@caesarxuchao
Copy link
Member Author

caesarxuchao commented Feb 13, 2019

Can you leave type aliases behind so as to not break people?

I can't do that for the disk cached one, otherwise there will be cyclic imports. It only has two public importers anyway.

For the mememory cached one, I didn't do the type aliase, because the package doesn't define any public type. I did add a glue package for the legacy code in the last commit.

@lavalamp
Copy link
Member

lavalamp commented Feb 13, 2019 via email

@deads2k
Copy link
Contributor

deads2k commented Feb 13, 2019

I don't feel strongly about an alias. This change lgtm

/lgtm
/approve
/hold

holding in case @lavalamp really wants an alias.

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 13, 2019
@caesarxuchao
Copy link
Member Author

@lavalamp no, the alias will introduce cycle no matter how we arrange the directory now, because of these two facts:

  • The disk cached client used to live in the discovery package.
  • The disk cached client depends on the discovery package.

@lavalamp
Copy link
Member

/approve
/hold cancel

I guess we break some interface every release, why stop now? :/

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 13, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caesarxuchao, deads2k, lavalamp

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2019
@caesarxuchao
Copy link
Member Author

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

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. area/apiserver area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

7 participants