Skip to content

Commit

Permalink
adjust
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
vvoland authored and thaJeztah committed Sep 24, 2024
1 parent 42f3831 commit 4ef0766
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cli/command/image/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
type fakeClient struct {
client.Client
imageTagFunc func(string, string) error
imageSaveFunc func(images []string) (io.ReadCloser, error)
imageSaveFunc func(images []string, _ ...image.SaveOptions) (io.ReadCloser, error)
imageRemoveFunc func(image string, options image.RemoveOptions) ([]image.DeleteResponse, error)
imagePushFunc func(ref string, options image.PushOptions) (io.ReadCloser, error)
infoFunc func() (system.Info, error)
Expand All @@ -26,7 +26,7 @@ type fakeClient struct {
imageListFunc func(options image.ListOptions) ([]image.Summary, error)
imageInspectFunc func(img string) (image.InspectResponse, []byte, error)
imageImportFunc func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error)
imageHistoryFunc func(img string) ([]image.HistoryResponseItem, error)
imageHistoryFunc func(img string, options ...image.HistoryOptions) ([]image.HistoryResponseItem, error)
imageBuildFunc func(context.Context, io.Reader, types.ImageBuildOptions) (types.ImageBuildResponse, error)
}

Expand Down
3 changes: 2 additions & 1 deletion cli/command/image/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/docker/cli/cli/command/completion"
"github.com/docker/cli/cli/command/formatter"
flagsHelper "github.com/docker/cli/cli/flags"
"github.com/docker/docker/api/types/image"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -49,7 +50,7 @@ func NewHistoryCommand(dockerCli command.Cli) *cobra.Command {
}

func runHistory(ctx context.Context, dockerCli command.Cli, opts historyOptions) error {
history, err := dockerCli.Client().ImageHistory(ctx, opts.image)
history, err := dockerCli.Client().ImageHistory(ctx, opts.image, image.HistoryOptions{})
if err != nil {
return err
}
Expand Down
8 changes: 5 additions & 3 deletions cli/command/image/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/completion"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/moby/sys/sequential"
"github.com/pkg/errors"
Expand Down Expand Up @@ -62,10 +63,11 @@ func runLoad(ctx context.Context, dockerCli command.Cli, opts loadOptions) error
return errors.Errorf("requested load from stdin, but stdin is empty")
}

if !dockerCli.Out().IsTerminal() {
opts.quiet = true
var loadOpts image.LoadOptions
if opts.quiet || !dockerCli.Out().IsTerminal() {
loadOpts.Quiet = true
}
response, err := dockerCli.Client().ImageLoad(ctx, input, opts.quiet)
response, err := dockerCli.Client().ImageLoad(ctx, input, image.LoadOptions{Quiet: opts.quiet})
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion cli/command/image/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/completion"
"github.com/docker/docker/api/types/image"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -51,7 +52,7 @@ func RunSave(ctx context.Context, dockerCli command.Cli, opts saveOptions) error
return errors.Wrap(err, "failed to save image")
}

responseBody, err := dockerCli.Client().ImageSave(ctx, opts.images)
responseBody, err := dockerCli.Client().ImageSave(ctx, opts.images, image.SaveOptions{})
if err != nil {
return err
}
Expand Down

0 comments on commit 4ef0766

Please sign in to comment.