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

Prometheus Golang Dependency Resolution #4468

Closed
swtch1 opened this Issue Aug 6, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@swtch1
Copy link

swtch1 commented Aug 6, 2018

Bug Report

What did you do?
I tried to use dep to resolve dependencies, and also tried to use go modules with the go1.11 beta 3 to get the code.

In trying to use Prometheus as a library (using data structures and methods for config and rulefmt validation) I am seeing several libraries whose code only exists within the prometheus/vendor folder. These are the primary examples:

  • github.com/Azure/azure-sdk-for-go/arm/compute
  • github.com/Azure/azure-sdk-for-go/arm/network
  • k8s.io/client-go/pkg/api
  • k8s.io/client-go/pkg/api/v1
  • k8s.io/client-go/pkg/apis/extensions/v1beta1

The crux of the issue is that this doesn't work:
go get github.com/Azure/azure-sdk-for-go/arm/compute which is a dependency.

What did you expect to see?
I expected for dependencies in prometheus/vendor to be externally resolvable.

What did you see instead? Under which circumstances?
I saw that these dependencies are not resolvable and do not exist, as far as I can tell, outside of the prometheus/vendor directory.

Environment
Windows 10 x64

General Question

This code is not obviously prometheus specific. Does this code in fact exist somewhere else that I can effectively resolve?

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Aug 6, 2018

This is why we vendor - because external dependencies can change or vanish at any time ;)

For example, the github.com/Azure/azure-sdk-for-go/arm/compute package does exist, but in that repository, the current master version does not contain that package anymore. However, it still exists at the revision we vendored it at (the revision is in vendor/vendor.json): https://github.com/Azure/azure-sdk-for-go/tree/bd73d950fa4440dae889bd9917bff7cef539f86e/arm/compute

You could vendor it at the same revision using dep by putting a revision constraint into your Gopkg.toml file. I haven't played with Go modules yet.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Aug 6, 2018

Closing this as it seems to be answered and is not a Prometheus issue. Please reopen if you think this was a mistake.

@juliusv juliusv closed this Aug 6, 2018

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.