|
|
@ -87,6 +87,7 @@ const (
|
|
|
|
AWSFargate = EnvType("fg")
|
|
|
|
AWSFargate = EnvType("fg")
|
|
|
|
FlyDotIo = EnvType("fly")
|
|
|
|
FlyDotIo = EnvType("fly")
|
|
|
|
Kubernetes = EnvType("k8s")
|
|
|
|
Kubernetes = EnvType("k8s")
|
|
|
|
|
|
|
|
DockerDesktop = EnvType("dde")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var envType atomic.Value // of EnvType
|
|
|
|
var envType atomic.Value // of EnvType
|
|
|
@ -144,6 +145,9 @@ func getEnvType() EnvType {
|
|
|
|
if inKubernetes() {
|
|
|
|
if inKubernetes() {
|
|
|
|
return Kubernetes
|
|
|
|
return Kubernetes
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if inDockerDesktop() {
|
|
|
|
|
|
|
|
return DockerDesktop
|
|
|
|
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -228,6 +232,13 @@ func inKubernetes() bool {
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func inDockerDesktop() bool {
|
|
|
|
|
|
|
|
if os.Getenv("TS_HOST_ENV") == "dde" {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type etcAptSrcResult struct {
|
|
|
|
type etcAptSrcResult struct {
|
|
|
|
mod time.Time
|
|
|
|
mod time.Time
|
|
|
|
disabled bool
|
|
|
|
disabled bool
|
|
|
|