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

Bump kubernetes/client-go #2848

Merged
merged 5 commits into from Feb 14, 2018
Merged

Conversation

yue9944882
Copy link
Contributor

@yue9944882 yue9944882 commented Feb 12, 2018

What does this PR do?

Briefly, this PR does the following things:

  1. Edit Gopkg.toml: Constraints client-go version to v6 and kubernetes/apixxx to release-1.9 branch.
  2. Align those moved / renamed packages in kubernetes repo.
  3. Strict kubernetes package naming: v1 -> corev1, v1beta1 -> extensionsv1beta1
  4. Fixes removed/deprecated functions since cilent-go 2.0.0.

Motivation

Fixes #2840.

More

  • Added/updated tests

Additional Notes

@yue9944882 yue9944882 requested a review from a team as a code owner February 12, 2018 19:20
@yue9944882 yue9944882 changed the title feat(kubernetes): bump kubernetes/client-go to v5.0.1 (1.8 branch) [WIP]feat(kubernetes): bump kubernetes/client-go to v5.0.1 (1.8 branch) Feb 12, 2018
@ldez
Copy link
Member

ldez commented Feb 12, 2018

@yue9944882 we don't really like WIP PR because:

  • each time you commit, you take 2 executors in our CI (we have only 4)
  • can block some other changes
  • we are notifying of each commit

Now, you have done this PR, could you work in another branch, run make test and make validate on your computer and when you are ready, push on this branch.

And could you rebase your PR on master.

@ldez
Copy link
Member

ldez commented Feb 12, 2018

@ldez ldez added WIP kind/enhancement a new or improved feature. and removed status/0-needs-triage labels Feb 12, 2018
@ldez ldez changed the title [WIP]feat(kubernetes): bump kubernetes/client-go to v5.0.1 (1.8 branch) Bump kubernetes/client-go to v5.0.1 (1.8 branch) Feb 12, 2018
@yue9944882
Copy link
Contributor Author

@ldez Okay, I will only push next time when this PR is completely ready. (Facepalm

@timoreimann
Copy link
Contributor

@yue9944882 Each client-go version should be completely backwards compatible, so I suggest we skip version 5 and go straight for version 6.

@timoreimann
Copy link
Contributor

In case you missed it: The official blog post on client-go v6 has some details on how to configure dep for v6 properly.

@ldez ldez changed the title Bump kubernetes/client-go to v5.0.1 (1.8 branch) Bump kubernetes/client-go Feb 12, 2018
@yue9944882
Copy link
Contributor Author

@timoreimann @ldez Even though this PR looks extremely large. But actually the changes is small. I will point out these changes in Code Review.

Copy link
Contributor Author

@yue9944882 yue9944882 left a comment

Choose a reason for hiding this comment

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

Other unmentioned changes is all about pkg moving or remaning.

Namespace(namespace).
Resource(resource).
VersionedParams(&options, api.ParameterCodec).
FieldsSelectorParam(fieldSelector).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This functions FieldsSelectorParam and LabelsSelectorParam is removed. And the selectors are moved into ListOptions

panic(err)
}

informer.AddEventHandler(newResourceEventHandler(watchCh))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AddEventHandler has no return value now.

fields.Everything(),
labelSelector)

informer := loadInformer(listWatch, &v1beta1.Ingress{}, watchCh)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ListerWatcher is moved from L301 to here.

@ldez
Copy link
Member

ldez commented Feb 12, 2018

@yue9944882 Could you revert all the changes on the vendor and leave the lock and the toml file and Traefik code, as first step, if possible.

@ldez
Copy link
Member

ldez commented Feb 12, 2018

If not possible please use make dep-ensure before push.

@ldez
Copy link
Member

ldez commented Feb 12, 2018

For the continuation, make commits like that.:

  1. one commit for Gopkg.toml and Gopkg.lock
  2. one commit for the Træfik code
  3. one commit for the vendored files (after the review)

Please respect this order, in a first time please don't commit vendored files.

@traefik traefik deleted a comment from yue9944882 Feb 12, 2018
@yue9944882
Copy link
Contributor Author

@ldez I am sure I've make dep-ensure before pushing the last commit.

Could you revert all the changes on the vendor and leave the lock and the toml file and Traefik code, as first step, if possible.

Actually reverting vendor will fail this PR. When I typed dep ensure -update k8s.io/client-go, dep didn't retrieve the latest dependency (e.g. github.com/juju/ratelimit) correctly which fails compiling of go binary. I think this can a potential BUG of dep. So I had a walk-around using dep ensure -update github.com/juju/ratelimit locally before pushing this PR, then it works again now.

@ldez
Copy link
Member

ldez commented Feb 12, 2018

Actually reverting vendor will fail this PR.

I know, but for now it's not important. Please revert.

git reset 7d3dd5a0e43b701a8231a8eff8d8024fcc7a5dba
git add Gopkg.*
git commit -m "chore: update dep configuration."
git add provider/ integration/
git commit -m "feat: update Traefik code."

# Do not do that for now 
# git add vendor/
# git commit -m "chore: update vendor."

You need to use dep 0.4.1 minimum, please check you version: dep version.

@ldez
Copy link
Member

ldez commented Feb 12, 2018

I think this can a potential BUG of dep.

And it's not a bug, it's the behavior of dep for transitive when a dependency don't use dep.

@yue9944882
Copy link
Contributor Author

yue9944882 commented Feb 12, 2018

git reset 7d3dd5a
git add Gopkg.*
git commit -m "chore: update dep configuration."
git add provider/ integration/
git commit -m "feat: update Traefik code."

@ldez Oops, I didn't notice these edition of the message you leave. How about editing these commit messages altogether after review? Btw I didn't modify files under integration/

@yue9944882
Copy link
Contributor Author

@ldez @timoreimann PTAL. The tests failing tho because missing upgrades of vendor.

@ldez
Copy link
Member

ldez commented Feb 12, 2018

Not needed 😉

@ldez
Copy link
Member

ldez commented Feb 12, 2018

Please wait, we need time to review.
For us, it's the night 😉

Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

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

Good job 👍

Gopkg.toml Outdated
name = "k8s.io/apimachinery"
version = "kubernetes-1.9.0"

[[constraint]]
Copy link
Member

Choose a reason for hiding this comment

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

Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  k8s.io/apiextensions-apiserver

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies,

Could you convert this constraint to override

Copy link
Contributor

Choose a reason for hiding this comment

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

It's more likely that we don't need it: k8s.io/apiextensions-apiserver is only required when dealing with things like CRDs, which we don't to the best of my knowledge.

If not used directly, I'd recommend to remove the stanza.

@yue9944882
Copy link
Contributor Author

@timoreimann I just find that k8s.io/kube-openapi is a transitive dependency by k8s.io/apimachinery. Adding this to constraints.

@ldez
Copy link
Member

ldez commented Feb 13, 2018

@yue9944882 it's good to me, now you can add the last commit with the vendor.

Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@timoreimann timoreimann left a comment

Choose a reason for hiding this comment

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

I gave the PR a quick test drive, validating that the core functionality (including cluster-wide and namespace-specific watches) is working as expected.

PR LGTM -- great job @yue9944882 👏

(Next stop: See if we can use some of the newer client-go features, such as the throttling backoff queue.)

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM
Nice job @yue9944882 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants