diff --git a/cmd/skopeo/inspect.go b/cmd/skopeo/inspect.go index 9f519c1c..d7d51238 100644 --- a/cmd/skopeo/inspect.go +++ b/cmd/skopeo/inspect.go @@ -222,13 +222,6 @@ func (opts *inspectOptions) run(args []string, stdout io.Writer) (retErr error) return printTmpl(row, data) } -func inspectNormalize(row string) string { - r := strings.NewReplacer( - ".ImageID", ".Image", - ) - return r.Replace(row) -} - func printTmpl(row string, data []interface{}) error { t, err := template.New("skopeo inspect").Parse(row) if err != nil { diff --git a/cmd/skopeo/list_tags_test.go b/cmd/skopeo/list_tags_test.go index 5d5ce17b..f0734eb3 100644 --- a/cmd/skopeo/list_tags_test.go +++ b/cmd/skopeo/list_tags_test.go @@ -5,6 +5,7 @@ import ( "github.com/containers/image/v5/transports/alltransports" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) // Tests the kinds of inputs allowed and expected to the command @@ -17,10 +18,10 @@ func TestDockerRepositoryReferenceParser(t *testing.T) { } { ref, err := parseDockerRepositoryReference(test[0]) + require.NoError(t, err) expected, err := alltransports.ParseImageName(test[0]) - if assert.NoError(t, err, "Could not parse, got error on %v", test[0]) { - assert.Equal(t, expected.DockerReference().Name(), ref.DockerReference().Name(), "Mismatched parse result for input %v", test[0]) - } + require.NoError(t, err) + assert.Equal(t, expected.DockerReference().Name(), ref.DockerReference().Name(), "Mismatched parse result for input %v", test[0]) } for _, test := range [][]string{ diff --git a/cmd/skopeo/login.go b/cmd/skopeo/login.go index 151db605..9dfe3d2b 100644 --- a/cmd/skopeo/login.go +++ b/cmd/skopeo/login.go @@ -12,7 +12,6 @@ import ( type loginOptions struct { global *globalOptions loginOpts auth.LoginOptions - getLogin optionalBool tlsVerify optionalBool } diff --git a/cmd/skopeo/sync.go b/cmd/skopeo/sync.go index 86694098..ccc6f59f 100644 --- a/cmd/skopeo/sync.go +++ b/cmd/skopeo/sync.go @@ -82,13 +82,13 @@ func syncCmd(global *globalOptions) *cobra.Command { cmd := &cobra.Command{ Use: "sync [command options] --src TRANSPORT --dest TRANSPORT SOURCE DESTINATION", Short: "Synchronize one or more images from one location to another", - Long: fmt.Sprint(`Copy all the images from a SOURCE to a DESTINATION. + Long: `Copy all the images from a SOURCE to a DESTINATION. Allowed SOURCE transports (specified with --src): docker, dir, yaml. Allowed DESTINATION transports (specified with --dest): docker, dir. See skopeo-sync(1) for details. -`), +`, RunE: commandAction(opts.run), Example: `skopeo sync --src docker --dest dir --scoped registry.example.com/busybox /media/usb`, } @@ -207,7 +207,6 @@ func getImageTags(ctx context.Context, sysCtx *types.SystemContext, repoRef refe // Some registries may decide to block the "list all tags" endpoint. // Gracefully allow the sync to continue in this case. logrus.Warnf("Registry disallows tag list retrieval: %s", err) - break default: return tags, errors.Wrapf(err, "Error determining repository tags for image %s", name) } diff --git a/cmd/skopeo/unshare.go b/cmd/skopeo/unshare.go index 13b1686f..acb2f29a 100644 --- a/cmd/skopeo/unshare.go +++ b/cmd/skopeo/unshare.go @@ -2,10 +2,6 @@ package main -func maybeReexec() error { - return nil -} - func reexecIfNecessaryForImages(inputImageNames ...string) error { return nil } diff --git a/cmd/skopeo/utils.go b/cmd/skopeo/utils.go index 61018294..dae03663 100644 --- a/cmd/skopeo/utils.go +++ b/cmd/skopeo/utils.go @@ -114,10 +114,6 @@ func imageFlags(global *globalOptions, shared *sharedImageOptions, flagPrefix, c return fs, opts } -type retryOptions struct { - maxRetry int // The number of times to possibly retry -} - func retryFlags() (pflag.FlagSet, *retry.RetryOptions) { opts := retry.RetryOptions{} fs := pflag.FlagSet{}