Skip to content

Commit

Permalink
Output workspace id when printing deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
andscoop committed Sep 7, 2018
1 parent 1f00aa1 commit 7a925b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions deployment/deployment.go
@@ -1,9 +1,10 @@
package deployment

import (
"errors"
"fmt"

"github.com/pkg/errors"

"github.com/astronomerio/astro-cli/config"
"github.com/astronomerio/astro-cli/houston"
"github.com/astronomerio/astro-cli/messages"
Expand Down Expand Up @@ -77,7 +78,7 @@ func List(ws string, all bool) error {

for _, d := range deployments {
if all {
ws = d.Workspace
ws = d.Workspace.Uuid
}
fullStr := fmt.Sprintf(r, d.Label, d.Id, d.ReleaseName, ws)
fmt.Println(fullStr)
Expand Down
10 changes: 8 additions & 2 deletions houston/houston.go
Expand Up @@ -77,6 +77,9 @@ var (
type
label
releaseName
workspace {
uuid
}
deployInfo {
latest
next
Expand All @@ -94,6 +97,9 @@ var (
type
label
releaseName
workspace {
uuid
}
deployInfo {
latest
next
Expand Down Expand Up @@ -329,15 +335,15 @@ func (c *Client) QueryHouston(query string) (*HoustonResponse, error) {
Raw: httpResponse,
Body: string(body),
}

decode := HoustonResponse{}
err = json.NewDecoder(strings.NewReader(response.Body)).Decode(&decode)
if err != nil {
return nil, errors.Wrap(err, "Failed to JSON decode Houston response")
}

// Houston Specific Errors
if decode.Errors != nil {
return nil, errors.New("failed to successfully decode response")
return nil, errors.New(decode.Errors[0].Message)
}

return &decode, nil
Expand Down

0 comments on commit 7a925b6

Please sign in to comment.