diff --git a/pkg/version/deployment.go b/pkg/version/deployment.go index f1ba092998ce..fd5c05ab1fff 100644 --- a/pkg/version/deployment.go +++ b/pkg/version/deployment.go @@ -110,6 +110,10 @@ func detectPlatform() string { return "railway" case os.Getenv("ECS_CONTAINER_METADATA_URI_V4") != "": return "ecs" + case os.Getenv("NOMAD_ALLOC_ID") != "": + return "nomad" + case os.Getenv("CONTAINER_APP_HOSTNAME") != "": + return "aca" } // Try to detect cloud provider through metadata endpoints @@ -157,6 +161,16 @@ func detectPlatform() string { } } + // Vultr metadata + if req, err := http.NewRequest(http.MethodGet, "http://169.254.169.254/v1/hostname", nil); err == nil { + if resp, err := client.Do(req); err == nil { + resp.Body.Close() + if resp.StatusCode == 200 { + return "vultr" + } + } + } + // Hetzner metadata if req, err := http.NewRequest(http.MethodGet, "http://169.254.169.254/hetzner/v1/metadata", nil); err == nil { if resp, err := client.Do(req); err == nil {