hostinfo: add fly.io detection

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
pull/2616/head
Denton Gentry 3 years ago committed by Denton Gentry
parent 0796c53404
commit 26c1183941

@ -28,6 +28,7 @@ const (
Heroku = EnvType("hr")
AzureAppService = EnvType("az")
AWSFargate = EnvType("fg")
FlyDotIo = EnvType("fly")
)
var envType atomic.Value // of EnvType
@ -57,6 +58,9 @@ func getEnvType() EnvType {
if inAWSFargate() {
return AWSFargate
}
if inFlyDotIo() {
return FlyDotIo
}
return ""
}
@ -126,3 +130,10 @@ func inAWSFargate() bool {
}
return false
}
func inFlyDotIo() bool {
if os.Getenv("FLY_APP_NAME") != "" && os.Getenv("FLY_REGION") != "" {
return true
}
return false
}

Loading…
Cancel
Save