mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-13 10:21:10 +01:00
18 lines
283 B
Go
18 lines
283 B
Go
|
package detect_platform
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func detectContainer(ctx context.Context) string {
|
||
|
if _, exists := os.LookupEnv("KUBERNETES_SERVICE_HOST"); exists {
|
||
|
return "Kubernetes"
|
||
|
}
|
||
|
|
||
|
if _, err := os.Stat("/.dockerenv"); err == nil {
|
||
|
return "Docker"
|
||
|
}
|
||
|
return ""
|
||
|
}
|