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>
This commit is contained in:
Denton Gentry 2021-07-04 18:58:58 -07:00 committed by Denton Gentry
parent 0ae2d2b3ab
commit d3697053c9

View File

@ -28,6 +28,7 @@
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
}