code.cloudfoundry.org/cli@v7.1.0+incompatible/actor/v7pushaction/handle_health_check_type_override.go (about) 1 package v7pushaction 2 3 import ( 4 "code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant" 5 "code.cloudfoundry.org/cli/command/translatableerror" 6 "code.cloudfoundry.org/cli/util/manifestparser" 7 ) 8 9 func HandleHealthCheckTypeOverride(manifest manifestparser.Manifest, overrides FlagOverrides) (manifestparser.Manifest, error) { 10 if overrides.HealthCheckType != "" { 11 if manifest.ContainsMultipleApps() { 12 return manifest, translatableerror.CommandLineArgsWithMultipleAppsError{} 13 } 14 15 webProcess := manifest.GetFirstAppWebProcess() 16 if webProcess != nil { 17 webProcess.HealthCheckType = overrides.HealthCheckType 18 if webProcess.HealthCheckType != constant.HTTP { 19 webProcess.HealthCheckEndpoint = "" 20 } 21 } else { 22 app := manifest.GetFirstApp() 23 app.HealthCheckType = overrides.HealthCheckType 24 if app.HealthCheckType != constant.HTTP { 25 app.HealthCheckEndpoint = "" 26 } 27 } 28 } 29 30 return manifest, nil 31 }