(processType string, appGUID string, updatedProcess resources.Process)
| 37 | } |
| 38 | |
| 39 | func (actor Actor) UpdateProcessByTypeAndApplication(processType string, appGUID string, updatedProcess resources.Process) (Warnings, error) { |
| 40 | if updatedProcess.HealthCheckType != constant.HTTP { |
| 41 | if updatedProcess.HealthCheckEndpoint != constant.ProcessHealthCheckEndpointDefault && updatedProcess.HealthCheckEndpoint != "" { |
| 42 | return nil, actionerror.HTTPHealthCheckInvalidError{} |
| 43 | } |
| 44 | |
| 45 | updatedProcess.HealthCheckEndpoint = "" |
| 46 | } |
| 47 | |
| 48 | process, warnings, err := actor.GetProcessByTypeAndApplication(processType, appGUID) |
| 49 | allWarnings := warnings |
| 50 | if err != nil { |
| 51 | return allWarnings, err |
| 52 | } |
| 53 | |
| 54 | updatedProcess.GUID = process.GUID |
| 55 | _, updateWarnings, err := actor.CloudControllerClient.UpdateProcess(resources.Process(updatedProcess)) |
| 56 | allWarnings = append(allWarnings, Warnings(updateWarnings)...) |
| 57 | if err != nil { |
| 58 | return allWarnings, err |
| 59 | } |
| 60 | |
| 61 | return allWarnings, nil |
| 62 | } |
no test coverage detected