micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6k stars 1.04k forks source link

Local Environment recognized as GCP when using AT&T Fiber #8804

Open MaxBeauchemin opened 1 year ago

MaxBeauchemin commented 1 year ago

Expected Behavior

Running the application locally should detect as local environment

Actual Behaviour

 __  __ _                                  _   
|  \/  (_) ___ _ __ ___  _ __   __ _ _   _| |_ 
| |\/| | |/ __| '__/ _ \| '_ \ / _` | | | | __|
| |  | | | (__| | | (_) | | | | (_| | |_| | |_ 
|_|  |_|_|\___|_|  \___/|_| |_|\__,_|\__,_|\__|
  Micronaut (v3.7.3)

10:11:58.294 [main] INFO  i.m.context.env.DefaultEnvironment - Established active environments: [gcp, cloud]

Steps To Reproduce

  1. Make sure you have AT&T Fiber internet and are not connected to a VPN
  2. Run the application
  3. Check the environment property from the application log output

Environment Information

I believe Micronaut is using metadata.google.internal as an identifier for GCP, but it appears AT&T has this mapped in their default DNS

ping metadata.google.internal
PING metadata.google.internal (23.221.222.250): 56 data bytes
64 bytes from 23.221.222.250: icmp_seq=0 ttl=48 time=52.257 ms

Example Application

No response

Version

3.7.0

graemerocher commented 1 year ago

you can disable environment detection for your use case (in Micronaut 4.x this will be disabled by default)