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

Function getRestartPolicy

agent/app/service/app_utils.go:1995–2004  ·  view source on GitHub ↗
(yml string)

Source from the content-addressed store, hash-verified

1993}
1994
1995func getRestartPolicy(yml string) string {
1996 var project docker.ComposeProject
1997 if err := yaml.Unmarshal([]byte(yml), &project); err != nil {
1998 return ""
1999 }
2000 for _, service := range project.Services {
2001 return service.Restart
2002 }
2003 return ""
2004}
2005
2006func getMajorVersion(version string) string {
2007 parts := strings.Split(version, ".")

Callers 1

GetParamsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected