Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1432 from weaveworks/errcheck
Browse files Browse the repository at this point in the history
Add error checks
  • Loading branch information
squaremo authored Oct 8, 2018
2 parents 04fdaf5 + 60e82a4 commit ee56fe9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cmd/fluxctl/release_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ func (opts *controllerReleaseOpts) RunE(cmd *cobra.Command, args []string) error
Cause: opts.cause,
Spec: spec,
})
if err != nil {
fmt.Fprintln(cmd.OutOrStderr(), err.Error())
return nil
}

opts.dryRun = false
}
Expand Down
8 changes: 7 additions & 1 deletion daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/weaveworks/flux"
"github.com/weaveworks/flux/api"
"github.com/weaveworks/flux/api/v10"
"github.com/weaveworks/flux/api/v11"
"github.com/weaveworks/flux/api/v6"
"github.com/weaveworks/flux/api/v9"
"github.com/weaveworks/flux/cluster"
Expand All @@ -27,7 +28,6 @@ import (
"github.com/weaveworks/flux/release"
"github.com/weaveworks/flux/resource"
"github.com/weaveworks/flux/update"
"github.com/weaveworks/flux/api/v11"
)

const (
Expand Down Expand Up @@ -175,12 +175,18 @@ func (d *Daemon) ListImagesWithOptions(ctx context.Context, opts v10.ListImagesO
var err error
if opts.Spec == update.ResourceSpecAll {
services, err = d.Cluster.AllControllers("")
if err != nil {
return nil, errors.Wrap(err, "getting all controllers")
}
} else {
id, err := opts.Spec.AsID()
if err != nil {
return nil, errors.Wrap(err, "treating service spec as ID")
}
services, err = d.Cluster.SomeControllers([]flux.ResourceID{id})
if err != nil {
return nil, errors.Wrap(err, "getting some controllers")
}
}

resources, _, err := d.getResources(ctx)
Expand Down
4 changes: 3 additions & 1 deletion git/operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ func TestOnelinelog_WithGitpath(t *testing.T) {
func TestCheckPush(t *testing.T) {
upstreamDir, upstreamCleanup := testfiles.TempDir(t)
defer upstreamCleanup()
err := createRepo(upstreamDir, []string{"config"})
if err := createRepo(upstreamDir, []string{"config"}); err != nil {
t.Fatal(err)
}

cloneDir, cloneCleanup := testfiles.TempDir(t)
defer cloneCleanup()
Expand Down
3 changes: 3 additions & 0 deletions remote/rpc/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ func listImagesWithOptions(ctx context.Context, client listImagesWithoutOptionsC
ns, _, _ = resourceID.Components()
}
services, err := client.ListServices(ctx, ns)
if err != nil {
return statuses, err
}

policyMap := map[flux.ResourceID]map[string]string{}
for _, service := range services {
Expand Down

0 comments on commit ee56fe9

Please sign in to comment.