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

.circleci/config.yml vendor gnostic for k8s.io/client-go #585

Merged
merged 3 commits into from
Feb 5, 2020

Conversation

knusbaum
Copy link
Contributor

@knusbaum knusbaum commented Feb 4, 2020

k8s.io/client-go has github.com/googleapis/gnostic as a dependency.
Recently, gnostic renamed some packages to be consistent with go style (google/gnostic#155)
This change breaks client-go, which will no longer build when clients are checked out with e.g. go get k8s.io/client-go/kubernetes.

k8s.io/client-go has not made it clear when/if they will fix their imports. They are closing issues opened against the repository with instructions on how to use go modules to circumvent the problem (kubernetes/client-go#741, kubernetes/client-go#743)

go get gopkg.in/DataDog/dd-trace-go.v1/... still works as expected. Unit tests still run, and I am still able to build against dd-trace-go. I have not tried building a program using the contrib/k8s.io/client-go/kubernetes integration.

This break in k8s.io/client-go is causing our CI to fail. This PR addresses the issue by checking out k8s.io/client-go manually and vendoring the last working version of gnostic in k8s.io/client-go/vendor.

@knusbaum knusbaum added this to the 1.21.0 milestone Feb 4, 2020
@knusbaum knusbaum force-pushed the knusbaum/fix-circleci branch from 41c6e51 to b3dd239 Compare February 4, 2020 02:57
@knusbaum knusbaum changed the title .circleci/config.yml pin gnostic at a v0.4.0 so k8s.io/client-go will compile. .circleci/config.yml vendor gnostic for k8s.io/client-go Feb 4, 2020
@knusbaum knusbaum force-pushed the knusbaum/fix-circleci branch from b3dd239 to d244412 Compare February 4, 2020 03:06
@knusbaum knusbaum requested review from gbbr and cgilmour February 4, 2020 03:10
@knusbaum knusbaum marked this pull request as ready for review February 4, 2020 03:11
cgilmour
cgilmour previously approved these changes Feb 4, 2020
Copy link
Contributor

@cgilmour cgilmour left a comment

Choose a reason for hiding this comment

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

This seems "fine" until it breaks again.

# k8s.io/client-go package, because it won't build with the
# current master.
command: >
git clone --branch v0.4.0
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't seem to matter in this case, but client-go uses 0.1.0 as their minimum link

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose the maximum, 0.4.0, that is before the breaking change. Since go get by default checks out the most recent, this is the closest version to what was already being built.

@cgilmour
Copy link
Contributor

cgilmour commented Feb 4, 2020

The "better ways" for having a stable CI involve modules or another form of dependency management instead of "temporary" cloning/vendoring.

But a perfectly stable CI doesn't necessarily reflect how things are for users, who may have updated to newer things than the versions we've pinned.

Since CI breakage regularly affects PRs from maintainers and contributors, it's worth considering a new approach to this.

Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

The comments don't make it clear why we need to do this. Can you please explain (either here in the PR or in the comments) ? "vendor [this] because it won't build with the current master" doesn't seem like a good explanation.

Will this work for users checking things out? When someone does go get gopkg.in/DataDog/dd-trace-go.v1/... will things break? What is the actual problem here? I think we need a good thorough PR description.

@knusbaum
Copy link
Contributor Author

knusbaum commented Feb 4, 2020

Sorry about that, @gbbr. I've added a detailed description to the PR.

@knusbaum knusbaum requested review from gbbr and cgilmour February 4, 2020 14:55
@knusbaum knusbaum modified the milestones: 1.21.0, 1.22.0 Feb 4, 2020
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

I'd like to request changes:

  • The comments (in the yaml file) are vague and don't make it clear why the steps are there.
  • We have two steps when we only need one. Both are addressing the same underlying issue and having them separate can be confusing.
  • We might not even need the second step and should use the suggested solution in Lowercase openapiv2 imports kubernetes/client-go#741.

@knusbaum knusbaum force-pushed the knusbaum/fix-circleci branch from 8092bd5 to 35008b9 Compare February 5, 2020 16:19
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Thanks Kyle. Almost there...

knusbaum and others added 2 commits February 5, 2020 10:42
Co-Authored-By: Gabriel Aszalos <gabriel.aszalos@gmail.com>
@knusbaum knusbaum requested a review from gbbr February 5, 2020 17:12
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Thanks!

mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this pull request Dec 22, 2020
k8s.io/client-go has github.com/googleapis/gnostic as a dependency.
Recently, gnostic renamed some packages to be consistent with go style (google/gnostic#155)
This change breaks client-go, which will no longer build when clients are checked out with e.g. go get k8s.io/client-go/kubernetes.

This break in k8s.io/client-go is causing our CI to fail. This commit addresses the issue by checking out k8s.io/client-go manually and vendoring the last working version of gnostic in k8s.io/client-go/vendor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants