metadata: support signaling "not on GCE" #4920
Labels
api: compute
Issues related to the Compute Engine API.
external
This issue is blocked on a bug with the actual product.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
Multiple components that we have running exactly same on multi-cloud/onprem environments have transitive dependency on this library, and metadata lookups for "on GCP" test keeps spamming our DNS servers.
Describe the solution you'd like
Please support, not only explicitly signaling via
GCE_METADATA_HOST
env var that the component is running on GCP (seegoogle-cloud-go/compute/metadata/metadata.go
Lines 117 to 121 in ea00264
Describe alternatives you've considered
I've considered configuring local DNS resolvers to treat *.internal as local domain, not to be resolved by DNS servers. Problem is we have some .internal domains which have to be resolved by DNS servers. Configuring more specific domain (like
metadata.google.internal
) as local or as ignored/refused is not supported on local resolver that we have. Replacing local resolver to a more capable one is considered to be way much more involving compared to updating dependency to this go library and setting an environment variable.Additional context
N/A
The text was updated successfully, but these errors were encountered: