Skip to content

Commit

Permalink
Reduce number of dependencies (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Jul 20, 2022
1 parent fb6b41c commit 919ebcf
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 74 deletions.
8 changes: 4 additions & 4 deletions cmd/gcr-cleaner-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/GoogleCloudPlatform/gcr-cleaner/pkg/gcrcleaner"
gcrauthn "github.com/google/go-containerregistry/pkg/authn"
gcrgoogle "github.com/google/go-containerregistry/pkg/v1/google"
"github.com/hashicorp/go-multierror"
)

var (
Expand Down Expand Up @@ -183,12 +182,12 @@ func realMain(ctx context.Context, logger *gcrcleaner.Logger) error {
since.Format(time.RFC3339), len(repos))

// Do the deletion.
var result *multierror.Error
var errs []error
for i, repo := range repos {
fmt.Fprintf(stdout, "%s\n", repo)
deleted, err := cleaner.Clean(ctx, repo, since, *keepPtr, tagFilter, *dryRunPtr)
if err != nil {
result = multierror.Append(result, err)
errs = append(errs, err)
}

if len(deleted) > 0 {
Expand All @@ -203,5 +202,6 @@ func realMain(ctx context.Context, logger *gcrcleaner.Logger) error {
fmt.Fprintf(stdout, "\n")
}
}
return result.ErrorOrNil()

return gcrcleaner.ErrsToError(errs)
}
22 changes: 9 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,25 @@ module github.com/GoogleCloudPlatform/gcr-cleaner
go 1.18

require (
github.com/gammazero/workerpool v1.1.2
github.com/google/go-containerregistry v0.9.0
github.com/hashicorp/go-multierror v1.1.1
github.com/google/go-containerregistry v0.10.0
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
)

require (
cloud.google.com/go/compute v1.6.1 // indirect
github.com/docker/cli v20.10.16+incompatible // indirect
cloud.google.com/go/compute v1.7.0 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.16+incompatible // indirect
github.com/docker/docker v20.10.17+incompatible // indirect
github.com/docker/docker-credential-helpers v0.6.4 // indirect
github.com/gammazero/deque v0.1.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
golang.org/x/net v0.0.0-20220531201128-c960675eff93 // indirect
golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
golang.org/x/oauth2 v0.0.0-20220718184931-c8730f7fcb92 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
)

0 comments on commit 919ebcf

Please sign in to comment.