mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 14:57:49 +00:00
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:
parent
0ae2d2b3ab
commit
d3697053c9
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user