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

Let release_1_5 clientset include multiple versions of a group #35471

Merged

Conversation

caesarxuchao
Copy link
Member

@caesarxuchao caesarxuchao commented Oct 24, 2016

Fix #35237

This PR make versioned clientset to include multiple versions of a group. Currently only batch has v1 and v2alpha1. The clientset interface now looks like:

    BatchV2alpha1() v2alpha1batch.BatchV2alpha1Interface
    BatchV1() v1batch.BatchV1Interface
    // Deprecated: please explicitly pick a version if possible.
    Batch() v1batch.BatchV1Interface

Commit "update client-gen to say internalversion rather than unversioned" fixes #24481.

cc @kubernetes/sig-api-machinery @soltysh @deads2k @nikhiljindal


This change is Reviewable

release_1_5 clientset supports multiple versions of a group.

@k8s-ci-robot
Copy link
Contributor

Jenkins Kubemark GCE e2e failed for commit 6c75e63. Full PR test history.

The magic incantation to run this job again is @k8s-bot kubemark e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE e2e failed for commit 6c75e63. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels Oct 24, 2016
@caesarxuchao caesarxuchao force-pushed the client-gen-multi-versions branch 3 times, most recently from dfc1c53 to 7cbd2c5 Compare October 25, 2016 05:14
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 25, 2016
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Some comments. Additionally the deprecation part could squashed into the main parts where the codegen is changed.


func TestVersionSort(t *testing.T) {
unsortedVersions := []string{"v4beta1", "v2beta1", "v2alpha1", "v3", "v1"}
expected := []string{"v2alpha1", "v2beta1", "v4beta1", "v1", "v3"}
Copy link
Contributor

Choose a reason for hiding this comment

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

The order here doesn't seem to be correct. I'd expect following:

{"v1", "v2alpha1", "v2beta1", "v4beta1", "v3"}

Copy link
Member Author

@caesarxuchao caesarxuchao Oct 26, 2016

Choose a reason for hiding this comment

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

I want to keep the default referring to a stable version. (e.g., .Batch() returns v1, not v2alpha1, which is behavior before this change)

Copy link
Member Author

Choose a reason for hiding this comment

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

@soltysh do you think it's reasonable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed on slack - ok.

@@ -187,6 +188,124 @@ var _ = framework.KubeDescribe("Generated release_1_5 clientset", func() {
})
})

func observeJobCreation(w watch.Interface) {
Copy link
Contributor

Choose a reason for hiding this comment

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

observeScheduledJobCreation

Copy link
Contributor

Choose a reason for hiding this comment

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

OT: instead of having multiple observe* why not having single generic function doing this, especially you're using watch.Interface as an argument.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Combined the functions.


var _ = framework.KubeDescribe("Generated release_1_5 clientset", func() {
f := framework.NewDefaultFramework("clientset")
It("should create v2alpha1 scheduleJobs, delete scheduleJobs, watch scheduleJobs", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good specific test to watch for regression in the 1.5 clientset. Nice job.

A more general test of this functionality would be good eventually, but seems like a big project.

@mml
Copy link
Contributor

mml commented Oct 26, 2016

LGTM once you address soltysh changes.

@caesarxuchao caesarxuchao force-pushed the client-gen-multi-versions branch 2 times, most recently from 0f68c3c to 8ba6391 Compare October 27, 2016 22:36
@caesarxuchao
Copy link
Member Author

Squashed and addressed the comments. Self apply the lgtm. Thank you for the quick review for a monster PR.

@caesarxuchao caesarxuchao added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2016
@k8s-github-robot k8s-github-robot added do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 27, 2016
@caesarxuchao caesarxuchao added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. labels Oct 27, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit 8ba6391a72e0d7ae8fee922bce4ac93cbd76c57b. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2016
@caesarxuchao caesarxuchao added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2016
@liggitt
Copy link
Member

liggitt commented Oct 27, 2016

I thought this was intended to drop after code freeze. This seems enormously disruptive for things working toward code freeze.

@caesarxuchao
Copy link
Member Author

@liggitt client-go currently passively copy the contents from the main repo, we don't develop in client-go. I need this PR to go in so that during code freeze I can have a client-go that's in the right shape for the migration.

By "disruptive" do you mean it will cause people to rebase? It shouldn't. I keep the original method like "Batch()", which returns the same interface as it used to do.

@caesarxuchao caesarxuchao added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 29, 2016
@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 29, 2016
@fejta
Copy link
Contributor

fejta commented Oct 29, 2016

BTW Given the scope of this PR I recommend you consider bumping up the priority.

@caesarxuchao
Copy link
Member Author

I'll add the milestone. The PR shouldn't cause many conflicts. Most changes are import lines.

@caesarxuchao caesarxuchao added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 29, 2016
@caesarxuchao caesarxuchao added this to the v1.5 milestone Oct 29, 2016
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2016
@caesarxuchao
Copy link
Member Author

@k8s-bot node e2e test this

@caesarxuchao
Copy link
Member Author

@k8s-bot node e2e test this, issue #34990

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2016
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
@caesarxuchao
Copy link
Member Author

Got conflict in test_owners.csv again. This is too much. I'm bumping the priority.

@caesarxuchao caesarxuchao added lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 29, 2016
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE Node e2e failed for commit 850729b. Full PR test history.

The magic incantation to run this job again is @k8s-bot node e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@caesarxuchao
Copy link
Member Author

@k8s-bot node e2e test this

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 7f309f5 into kubernetes:master Oct 29, 2016
@caesarxuchao
Copy link
Member Author

ScheduleJob is not enabled on gke. So gke tests are failing now. I'll send a fix soon.

@caesarxuchao
Copy link
Member Author

Sent #35855.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
9 participants