From e5760d9f262e79d52e6569d8c4c70dceb408004d Mon Sep 17 00:00:00 2001 From: Steven Maude Date: Mon, 2 Sep 2024 18:40:14 +0100 Subject: [PATCH] Update for renames in Docker API v27 --- pkg/builder/builder.go | 4 ++-- pkg/source/sources.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/builder/builder.go b/pkg/builder/builder.go index 120ac68..de24b6b 100644 --- a/pkg/builder/builder.go +++ b/pkg/builder/builder.go @@ -11,7 +11,7 @@ import ( "regexp" "strings" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/image" "github.com/docker/docker/pkg/jsonmessage" "github.com/sensiblecodeio/hookbot/pkg/listen" "github.com/urfave/cli" @@ -78,7 +78,7 @@ func Action(c *cli.Context) { blankAuth := base64.URLEncoding.EncodeToString([]byte("{}")) - rc, err2 := client.ImagePush(context.TODO(), ref, types.ImagePushOptions{ + rc, err2 := client.ImagePush(context.TODO(), ref, image.PushOptions{ RegistryAuth: blankAuth, }) if err2 != nil { diff --git a/pkg/source/sources.go b/pkg/source/sources.go index 7a87635..1ae8702 100644 --- a/pkg/source/sources.go +++ b/pkg/source/sources.go @@ -13,6 +13,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/network" docker "github.com/docker/docker/client" "github.com/docker/docker/pkg/archive" @@ -84,7 +85,7 @@ func DockerPullSourceFromImage(image string) *DockerPullSource { func (s *DockerPullSource) Obtain(c *docker.Client, payload []byte) (string, error) { imageName := fmt.Sprintf("%s:%s", s.Repository, s.Tag) - rc, err := c.ImagePull(context.TODO(), imageName, types.ImagePullOptions{}) + rc, err := c.ImagePull(context.TODO(), imageName, image.PullOptions{}) if err != nil { return "", err }