(operatorConfig OperatorConfig, configPath string, deploymentBytesMap map[string][]byte, force bool)
| 26 | ) |
| 27 | |
| 28 | func Deploy(operatorConfig OperatorConfig, configPath string, deploymentBytesMap map[string][]byte, force bool) ([]schema.DeployResult, error) { |
| 29 | params := map[string]string{ |
| 30 | "force": s.Bool(force), |
| 31 | "configFileName": filepath.Base(configPath), |
| 32 | } |
| 33 | uploadInput := &HTTPUploadInput{ |
| 34 | Bytes: deploymentBytesMap, |
| 35 | } |
| 36 | |
| 37 | response, err := HTTPUpload(operatorConfig, "/deploy", uploadInput, params) |
| 38 | if err != nil { |
| 39 | return nil, err |
| 40 | } |
| 41 | |
| 42 | var deployResults []schema.DeployResult |
| 43 | if err := json.Unmarshal(response, &deployResults); err != nil { |
| 44 | return nil, errors.Wrap(err, "/deploy", string(response)) |
| 45 | } |
| 46 | |
| 47 | return deployResults, nil |
| 48 | } |
no test coverage detected