Skip to content

Commit

Permalink
Add missing sync=true during cloud role update (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriisoldatenko committed May 15, 2020
1 parent 2ec2450 commit c4fdeda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion deployment/deployment.go
Expand Up @@ -149,9 +149,16 @@ func List(ws string, all bool, client *houston.Client, out io.Writer) error {

// Update an airflow deployment
func Update(id, cloudRole string, args map[string]string) error {
vars := map[string]interface{}{"deploymentId": id, "payload": args, "cloudRole": cloudRole}

// sync with commander only when we have cloudRole
if cloudRole != "" {
vars["sync"] = true
}

req := houston.Request{
Query: houston.DeploymentUpdateRequest,
Variables: map[string]interface{}{"deploymentId": id, "payload": args, "cloudRole": cloudRole},
Variables: vars,
}

r, err := req.Do()
Expand Down
4 changes: 2 additions & 2 deletions houston/queries.go
Expand Up @@ -90,8 +90,8 @@ var (
}`

DeploymentUpdateRequest = `
mutation UpdateDeployment($deploymentId: Uuid!, $payload: JSON!, $cloudRole: String) {
updateDeployment(deploymentUuid: $deploymentId, payload: $payload, cloudRole: $cloudRole) {
mutation UpdateDeployment($deploymentId: Uuid!, $payload: JSON!, $cloudRole: String, $sync: Boolean) {
updateDeployment(deploymentUuid: $deploymentId, payload: $payload, cloudRole: $cloudRole, sync: $sync) {
id
type
label
Expand Down

0 comments on commit c4fdeda

Please sign in to comment.