Skip to content

Commit

Permalink
Merge pull request #316 from jumppad-labs/erik/fix-docker-deps
Browse files Browse the repository at this point in the history
Update deps and fix resulting issues
  • Loading branch information
nicholasjackson authored Feb 21, 2025
2 parents 134ed58 + 24b6c6a commit 2778913
Show file tree
Hide file tree
Showing 24 changed files with 1,559 additions and 400 deletions.
4 changes: 2 additions & 2 deletions cmd/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"strings"
"sync"

"github.com/docker/docker/api/types"
"github.com/fatih/color"
hcltypes "github.com/jumppad-labs/hclconfig/types"
"github.com/spf13/cobra"

dcontainer "github.com/docker/docker/api/types/container"
"github.com/jumppad-labs/jumppad/pkg/clients/container"
"github.com/jumppad-labs/jumppad/pkg/clients/logger"
"github.com/jumppad-labs/jumppad/pkg/config"
Expand Down Expand Up @@ -102,7 +102,7 @@ func newLogCmdFunc(dc container.Docker, stdout, stderr io.Writer) func(cmd *cobr
rc, err := dc.ContainerLogs(
ctx,
r,
types.ContainerLogsOptions{
dcontainer.LogsOptions{
ShowStdout: true,
ShowStderr: true,
Follow: true,
Expand Down
8 changes: 4 additions & 4 deletions cmd/purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"path"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
dimage "github.com/docker/docker/api/types/image"
"github.com/jumppad-labs/jumppad/pkg/clients/container"
"github.com/jumppad-labs/jumppad/pkg/clients/images"
"github.com/jumppad-labs/jumppad/pkg/clients/logger"
Expand Down Expand Up @@ -40,7 +40,7 @@ func newPurgeCmdFunc(dt container.Docker, il images.ImageLog, l logger.Logger) f
for _, i := range images {
l.Info("Removing image", "image", i)

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

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

_, err := dt.ImageRemove(context.Background(), i.ID, types.ImageRemoveOptions{Force: true, PruneChildren: true})
_, err := dt.ImageRemove(context.Background(), i.ID, dimage.RemoveOptions{Force: true, PruneChildren: true})
if err != nil {
l.Error("Unable to delete", "image", i.ID, "error", err)
bHasError = true
Expand Down
7 changes: 4 additions & 3 deletions cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import (

"github.com/cucumber/godog"
"github.com/cucumber/godog/colors"
"github.com/docker/docker/api/types"
dcontainer "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
dnetwork "github.com/docker/docker/api/types/network"
"github.com/jumppad-labs/hclconfig/resources"
"github.com/jumppad-labs/jumppad/pkg/clients"
"github.com/jumppad-labs/jumppad/pkg/clients/logger"
Expand Down Expand Up @@ -387,7 +388,7 @@ func (cr *CucumberRunner) thereShouldBeAResourceRunningCalled(id string) error {
for i := 0; i < 100; i++ {
args := filters.NewArgs()
args.Add("name", id)
opts := types.ContainerListOptions{Filters: args, All: true}
opts := dcontainer.ListOptions{Filters: args, All: true}

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

if err != nil {
return err
Expand Down
Loading

0 comments on commit 2778913

Please sign in to comment.