MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / isHostModel

Function isHostModel

agent/app/service/app_utils.go:1946–1960  ·  view source on GitHub ↗
(dockerCompose string)

Source from the content-addressed store, hash-verified

1944}
1945
1946func isHostModel(dockerCompose string) bool {
1947 composeMap := make(map[string]interface{})
1948 _ = yaml.Unmarshal([]byte(dockerCompose), &composeMap)
1949 services, serviceValid := composeMap["services"].(map[string]interface{})
1950 if !serviceValid {
1951 return false
1952 }
1953 for _, service := range services {
1954 serviceValue := service.(map[string]interface{})
1955 if value, ok := serviceValue["network_mode"]; ok && value == "host" {
1956 return true
1957 }
1958 }
1959 return false
1960}
1961
1962func copyAppDetailMissing(fileOp files.FileOp, srcDir, dstDir string) error {
1963 entries, err := os.ReadDir(srcDir)

Callers 3

GetParamsMethod · 0.85
GetAppDetailMethod · 0.85
GetAppDetailByIDMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected