MCPcopy Create free account
hub / github.com/ddev/ddev / GetDDEVEnvironment

Function GetDDEVEnvironment

pkg/environment/environment.go:23–35  ·  view source on GitHub ↗

GetDDEVEnvironment returns the type of environment DDEV is being used in

()

Source from the content-addressed store, hash-verified

21
22// GetDDEVEnvironment returns the type of environment DDEV is being used in
23func GetDDEVEnvironment() string {
24 e := runtime.GOOS
25 switch {
26 case nodeps.IsCodespaces():
27 e = DDEVEnvironmentCodespaces
28 case nodeps.IsDevcontainer():
29 e = DDEVEnvironmentDevcontainer
30 case nodeps.IsWSL2():
31 e = wsl2Environment()
32 }
33
34 return e
35}
36
37// wsl2Environment returns the specific WSL2 environment type by calling
38// GetWSL2NetworkingMode once. nat is the common case; others are unusual.

Callers 2

GetVersionInfoFunction · 0.92
identifyFunction · 0.92

Calls 4

IsCodespacesFunction · 0.92
IsDevcontainerFunction · 0.92
IsWSL2Function · 0.92
wsl2EnvironmentFunction · 0.85

Tested by

no test coverage detected