mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-15 03:11:02 +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 ""
|
||
|
}
|