1
0
Fork 0

Adding compatibility for marathon 1.5

This commit is contained in:
Trevin Teacutter 2018-07-03 16:42:03 -05:00 committed by Traefiker Bot
parent 461ebf6d88
commit 04d8b5d483
35 changed files with 2257 additions and 63 deletions

View file

@ -29,6 +29,7 @@ type Deployment struct {
CurrentStep int `json:"currentStep"`
TotalSteps int `json:"totalSteps"`
AffectedApps []string `json:"affectedApps"`
AffectedPods []string `json:"affectedPods"`
Steps [][]*DeploymentStep `json:"-"`
XXStepsRaw json.RawMessage `json:"steps"` // Holds raw steps JSON to unmarshal later
CurrentActions []*DeploymentStep `json:"currentActions"`
@ -107,8 +108,17 @@ func (r *marathonClient) Deployments() ([]*Deployment, error) {
// id: the deployment id you wish to delete
// force: whether or not to force the deletion
func (r *marathonClient) DeleteDeployment(id string, force bool) (*DeploymentID, error) {
path := fmt.Sprintf("%s/%s", marathonAPIDeployments, id)
// if force=true, no body is returned
if force {
path += "?force=true"
return nil, r.apiDelete(path, nil, nil)
}
deployment := new(DeploymentID)
err := r.apiDelete(fmt.Sprintf("%s/%s", marathonAPIDeployments, id), nil, deployment)
err := r.apiDelete(path, nil, deployment)
if err != nil {
return nil, err
}