hostinfo: add AWS Fargate.

Several other AWS services like App Run and Lightsail Containers
appear to be layers atop Fargate, to the point that we cannot easily
tell them apart from within the container. Contacting the metadata
service would distinguish them, but doing that from inside tailscaled
seems uncalled for. Just report them as Fargate.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
pull/2429/head
Denton Gentry 3 years ago committed by Denton Gentry
parent 0ae2d2b3ab
commit d3697053c9

@ -28,6 +28,7 @@ const (
AWSLambda = EnvType("lm")
Heroku = EnvType("hr")
AzureAppService = EnvType("az")
AWSFargate = EnvType("fg")
TestCase = EnvType("tc")
)
@ -60,6 +61,9 @@ func getEnvType() EnvType {
if inAzureAppService() {
return AzureAppService
}
if inAWSFargate() {
return AWSFargate
}
return ""
}
@ -129,3 +133,10 @@ func inAzureAppService() bool {
}
return false
}
func inAWSFargate() bool {
if os.Getenv("AWS_EXECUTION_ENV") == "AWS_ECS_FARGATE" {
return true
}
return false
}

Loading…
Cancel
Save