Skip to content

compute/metadata: short description of bug #5062

@Deiz

Description

@Deiz

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.

Metadata

Metadata

Assignees

Labels

api: computeIssues related to the Compute Engine API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions