hiteshjoshi / goauth2

Automatically exported from code.google.com/p/goauth2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Update compute/serviceaccount to work with Docker #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a sample program that uses service accounts (e.g. 
https://gist.github.com/paddyforan/2522952517381aedc3ff)
2. Run said program from inside a Docker container

What is the expected output? What do you see instead?

The test program above should output a list of objects in a given GCS bucket. 
Instead, it returns the following error:

Get http://metadata/computeMetadata/v1/instance/service-accounts/default/token: 
dial tcp: lookup metadata: no such host

What version of the product are you using? On what operating system?

afe77d958c70, on CoreOS 410.2.0 in Google Compute Engine, on Docker with the 
following versions:

Client version: 1.1.2
Client API version: 1.13
Go version (client): go1.2
Git commit (client): d84a070
Server version: 1.1.2
Server API version: 1.13
Go version (server): go1.2
Git commit (server): d84a070

Please provide any additional information below.

I've successfully worked around this issue by vendoring the serviceaccount.go 
file, changing the metadataServer constant to "metadata.google.internal", and 
changing "serviceaccount.NewClient" to "NewClient". Obviously, this forking is 
undesirable and merging in a change upstream would be a preferable path forward.

Original issue reported on code.google.com by pa...@secondbit.org on 4 Oct 2014 at 4:04

GoogleCodeExporter commented 9 years ago
I think, ideally, the solution to this would be allowing a metadata server host 
to be passed in as part of the Options struct used when creating a new client.

Original comment by pa...@secondbit.org on 4 Oct 2014 at 5:03

GoogleCodeExporter commented 9 years ago
New work is not going to be done on goauth2. 

Take a look at https://github.com/golang/oauth2 and 
https://google.golang.org/compute - a rewrite that is very nearly ready for 
mass consumption.

Original comment by a...@golang.org on 4 Oct 2014 at 10:53

GoogleCodeExporter commented 9 years ago
https://google.golang.org/compute is throwing a 404. The Github link works, but 
has the same issue. I'll open an issue on that repo, with a pull request 
possibly forthcoming.

Original comment by pa...@paddy.io on 6 Oct 2014 at 2:55