Skip to content

Commit

Permalink
api: Parse version flags in deploy rebuild and rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarsa committed May 14, 2020
1 parent 47585f8 commit 0940b4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/deploy.go
Expand Up @@ -219,6 +219,8 @@ func deployRollback(w http.ResponseWriter, r *http.Request, t auth.Token) error
Origin: origin,
Rollback: true,
}
opts.NewVersion, _ = strconv.ParseBool(InputValue(r, "new-version"))
opts.OverrideVersions, _ = strconv.ParseBool(InputValue(r, "override-versions"))
opts.GetKind()
canRollback := permission.Check(t, permSchemeForDeploy(opts), contextsForApp(instance)...)
if !canRollback {
Expand Down Expand Up @@ -340,6 +342,8 @@ func deployRebuild(w http.ResponseWriter, r *http.Request, t auth.Token) error {
Origin: origin,
Kind: app.DeployRebuild,
}
opts.NewVersion, _ = strconv.ParseBool(InputValue(r, "new-version"))
opts.OverrideVersions, _ = strconv.ParseBool(InputValue(r, "override-versions"))
canDeploy := permission.Check(t, permSchemeForDeploy(opts), contextsForApp(instance)...)
if !canDeploy {
return &tsuruErrors.HTTP{Code: http.StatusForbidden, Message: permission.ErrUnauthorized.Error()}
Expand Down

0 comments on commit 0940b4b

Please sign in to comment.