Skip to content

Commit 2778913

Browse files
Merge pull request #316 from jumppad-labs/erik/fix-docker-deps
Update deps and fix resulting issues
2 parents 134ed58 + 24b6c6a commit 2778913

24 files changed

+1559
-400
lines changed

cmd/log.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
"strings"
1212
"sync"
1313

14-
"github.com/docker/docker/api/types"
1514
"github.com/fatih/color"
1615
hcltypes "github.com/jumppad-labs/hclconfig/types"
1716
"github.com/spf13/cobra"
1817

18+
dcontainer "github.com/docker/docker/api/types/container"
1919
"github.com/jumppad-labs/jumppad/pkg/clients/container"
2020
"github.com/jumppad-labs/jumppad/pkg/clients/logger"
2121
"github.com/jumppad-labs/jumppad/pkg/config"
@@ -102,7 +102,7 @@ func newLogCmdFunc(dc container.Docker, stdout, stderr io.Writer) func(cmd *cobr
102102
rc, err := dc.ContainerLogs(
103103
ctx,
104104
r,
105-
types.ContainerLogsOptions{
105+
dcontainer.LogsOptions{
106106
ShowStdout: true,
107107
ShowStderr: true,
108108
Follow: true,

cmd/purge.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"os"
77
"path"
88

9-
"github.com/docker/docker/api/types"
109
"github.com/docker/docker/api/types/filters"
10+
dimage "github.com/docker/docker/api/types/image"
1111
"github.com/jumppad-labs/jumppad/pkg/clients/container"
1212
"github.com/jumppad-labs/jumppad/pkg/clients/images"
1313
"github.com/jumppad-labs/jumppad/pkg/clients/logger"
@@ -40,7 +40,7 @@ func newPurgeCmdFunc(dt container.Docker, il images.ImageLog, l logger.Logger) f
4040
for _, i := range images {
4141
l.Info("Removing image", "image", i)
4242

43-
_, err := dt.ImageRemove(context.Background(), i, types.ImageRemoveOptions{Force: true, PruneChildren: true})
43+
_, err := dt.ImageRemove(context.Background(), i, dimage.RemoveOptions{Force: true, PruneChildren: true})
4444
if err != nil {
4545
l.Error("Unable to delete", "image", i, "error", err)
4646
}
@@ -52,7 +52,7 @@ func newPurgeCmdFunc(dt container.Docker, il images.ImageLog, l logger.Logger) f
5252
filter.Add("reference", "jumppad.dev/localcache/*")
5353

5454
// check if the image already exists, if so do not rebuild unless force
55-
sum, err := dt.ImageList(context.Background(), types.ImageListOptions{Filters: filter})
55+
sum, err := dt.ImageList(context.Background(), dimage.ListOptions{Filters: filter})
5656
if err != nil {
5757
l.Error("Unable to check image cache", "error", err)
5858
bHasError = true
@@ -61,7 +61,7 @@ func newPurgeCmdFunc(dt container.Docker, il images.ImageLog, l logger.Logger) f
6161
for _, i := range sum {
6262
l.Info("Removing image", "image", i.ID)
6363

64-
_, err := dt.ImageRemove(context.Background(), i.ID, types.ImageRemoveOptions{Force: true, PruneChildren: true})
64+
_, err := dt.ImageRemove(context.Background(), i.ID, dimage.RemoveOptions{Force: true, PruneChildren: true})
6565
if err != nil {
6666
l.Error("Unable to delete", "image", i.ID, "error", err)
6767
bHasError = true

cmd/test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import (
2323

2424
"github.com/cucumber/godog"
2525
"github.com/cucumber/godog/colors"
26-
"github.com/docker/docker/api/types"
26+
dcontainer "github.com/docker/docker/api/types/container"
2727
"github.com/docker/docker/api/types/filters"
28+
dnetwork "github.com/docker/docker/api/types/network"
2829
"github.com/jumppad-labs/hclconfig/resources"
2930
"github.com/jumppad-labs/jumppad/pkg/clients"
3031
"github.com/jumppad-labs/jumppad/pkg/clients/logger"
@@ -387,7 +388,7 @@ func (cr *CucumberRunner) thereShouldBeAResourceRunningCalled(id string) error {
387388
for i := 0; i < 100; i++ {
388389
args := filters.NewArgs()
389390
args.Add("name", id)
390-
opts := types.ContainerListOptions{Filters: args, All: true}
391+
opts := dcontainer.ListOptions{Filters: args, All: true}
391392

392393
cl, err := cr.cli.Docker.ContainerList(context.Background(), opts)
393394
if err != nil {
@@ -419,7 +420,7 @@ func (cr *CucumberRunner) thereShouldBeAResourceRunningCalled(id string) error {
419420
func (cr *CucumberRunner) thereShouldBe1NetworkCalled(arg1 string) error {
420421
args := filters.NewArgs()
421422
args.Add("name", arg1)
422-
n, err := cr.cli.Docker.NetworkList(context.Background(), types.NetworkListOptions{Filters: args})
423+
n, err := cr.cli.Docker.NetworkList(context.Background(), dnetwork.ListOptions{Filters: args})
423424

424425
if err != nil {
425426
return err

0 commit comments

Comments
 (0)