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

compute/metadata: short description of bug #5062

Closed
Deiz opened this issue Nov 2, 2021 · 1 comment · Fixed by #5063
Closed

compute/metadata: short description of bug #5062

Deiz opened this issue Nov 2, 2021 · 1 comment · Fixed by #5063
Assignees
Labels
api: compute Issues related to the Compute Engine API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@Deiz
Copy link
Contributor

Deiz commented Nov 2, 2021

Client

metadata

Code

e.g.

package main

func main() {
	email, err := metadata.Get("/instance/service-accounts/default/email")
	if err != nil {
		// err should be non-nil if the metadata server is unreachable (i.e. not running on GCP)
	}

	// instead, we wind up here with a zero-value email
}

Expected behavior

When not running on GCP, or otherwise unable to reach the metadata server, this package's operations should fail.

Actual behavior

A nil error and zero-value string are returned.

This is occurring due to the fix for #4713.

@Deiz Deiz added the triage me I really want to be triaged. label Nov 2, 2021
@product-auto-label product-auto-label bot added the api: compute Issues related to the Compute Engine API. label Nov 2, 2021
@codyoss codyoss added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Nov 2, 2021
@codyoss codyoss self-assigned this Nov 2, 2021
@codyoss
Copy link
Member

codyoss commented Nov 2, 2021

@Deiz Thanks for the report, I will take a look at your PR shortly!

codyoss pushed a commit that referenced this issue Nov 3, 2021
…5063)

Minor change to ensure an error is returned to the caller when all retries have failed.

Fixes #5062
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: compute Issues related to the Compute Engine API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants