Skip to content

Commit

Permalink
Merge pull request #554 from buildtool/dependabot/go_modules/github.c…
Browse files Browse the repository at this point in the history
…om/docker/docker-24.0.1incompatible

chore(deps): bump github.com/docker/docker from 23.0.3+incompatible to 24.0.1+incompatible
  • Loading branch information
peter-svensson authored May 20, 2023
2 parents ee650e7 + 840ec22 commit 5b5097d
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/containerd/containerd v1.7.1
github.com/containerd/continuity v0.3.1-0.20230206214859-2a963a2f56e8 // indirect
github.com/daviddengcn/go-colortext v1.0.0 // indirect
github.com/docker/docker v23.0.3+incompatible
github.com/docker/docker v24.0.1+incompatible
github.com/docker/go-connections v0.4.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
github.com/fvbommel/sortorder v1.1.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ github.com/daviddengcn/go-colortext v1.0.0 h1:ANqDyC0ys6qCSvuEK7l3g5RaehL/Xck9EX
github.com/daviddengcn/go-colortext v1.0.0/go.mod h1:zDqEI5NVUop5QPpVJUxE9UO10hRnmkD5G4Pmri9+m4c=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho=
github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v24.0.1+incompatible h1:NxN81beIxDlUaVt46iUQrYHD9/W3u9EGl52r86O/IGw=
github.com/docker/docker v24.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=
Expand Down
6 changes: 3 additions & 3 deletions pkg/docker/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ import (

authutil "github.com/containerd/containerd/remotes/docker/auth"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"
"github.com/moby/buildkit/session"
"github.com/moby/buildkit/session/auth"
"golang.org/x/crypto/nacl/sign"
"google.golang.org/grpc"
)

type authenticator struct {
authConfig types.AuthConfig
authConfig registry.AuthConfig
registryHost string
}

func NewAuthenticator(registryHost string, authConfig types.AuthConfig) Authenticator {
func NewAuthenticator(registryHost string, authConfig registry.AuthConfig) Authenticator {
return &authenticator{
authConfig: authConfig,
registryHost: registryHost,
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (
"context"
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"
auth2 "github.com/moby/buildkit/session/auth"
"github.com/stretchr/testify/require"
)

func Test_Credentials(t *testing.T) {
auth := NewAuthenticator("use-auth.com", types.AuthConfig{
auth := NewAuthenticator("use-auth.com", registry.AuthConfig{
Username: "user",
Password: "password",
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
)

type Client interface {
RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error)
RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)
ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
ImagePush(ctx context.Context, image string, options types.ImagePushOptions) (io.ReadCloser, error)
DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (m *MockDocker) ImagePush(ctx context.Context, image string, options types.
return io.NopCloser(strings.NewReader(*m.PushOutput)), nil
}

func (m *MockDocker) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) {
func (m *MockDocker) RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error) {
m.Username = auth.Username
m.Password = auth.Password
m.ServerAddress = auth.ServerAddress
Expand Down
2 changes: 1 addition & 1 deletion pkg/push/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"github.com/buildtool/build-tools/pkg/vcs"
"github.com/buildtool/build-tools/pkg/version"

"github.com/docker/docker/api/types"
types "github.com/docker/docker/api/types/registry"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/registry/dockerhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"encoding/json"

"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"

"github.com/buildtool/build-tools/pkg/docker"
)
Expand Down Expand Up @@ -60,8 +60,8 @@ func (r Dockerhub) Login(client docker.Client) error {
}
}

func (r Dockerhub) GetAuthConfig() types.AuthConfig {
return types.AuthConfig{Username: r.Username, Password: r.Password}
func (r Dockerhub) GetAuthConfig() registry.AuthConfig {
return registry.AuthConfig{Username: r.Username, Password: r.Password}
}

func (r Dockerhub) GetAuthInfo() string {
Expand Down
8 changes: 4 additions & 4 deletions pkg/registry/ecr.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"github.com/aws/aws-sdk-go/service/ecr/ecriface"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/aws/aws-sdk-go/service/sts/stsiface"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"

"github.com/buildtool/build-tools/pkg/docker"
)
Expand Down Expand Up @@ -111,16 +111,16 @@ func (r *ECR) Login(client docker.Client) error {
r.username = parts[0]
r.password = parts[1]

if ok, err := client.RegistryLogin(context.Background(), types.AuthConfig{Username: r.username, Password: r.password, ServerAddress: r.Url}); err == nil {
if ok, err := client.RegistryLogin(context.Background(), registry.AuthConfig{Username: r.username, Password: r.password, ServerAddress: r.Url}); err == nil {
log.Debugf("%s\n", ok.Status)
return nil
} else {
return err
}
}

func (r *ECR) GetAuthConfig() types.AuthConfig {
return types.AuthConfig{Username: r.username, Password: r.password}
func (r *ECR) GetAuthConfig() registry.AuthConfig {
return registry.AuthConfig{Username: r.username, Password: r.password}
}

func (r *ECR) GetAuthInfo() string {
Expand Down
10 changes: 5 additions & 5 deletions pkg/registry/gcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"encoding/json"

"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"

"github.com/buildtool/build-tools/pkg/docker"
)
Expand All @@ -49,7 +49,7 @@ func (r *GCR) Configured() bool {
if len(r.Url) <= 0 || len(r.KeyFileContent) <= 0 {
return false
}
return r.GetAuthConfig() != types.AuthConfig{}
return r.GetAuthConfig() != registry.AuthConfig{}
}

func (r *GCR) Login(client docker.Client) error {
Expand All @@ -63,12 +63,12 @@ func (r *GCR) Login(client docker.Client) error {
}
}

func (r *GCR) GetAuthConfig() types.AuthConfig {
func (r *GCR) GetAuthConfig() registry.AuthConfig {
decoded, err := base64.StdEncoding.DecodeString(r.KeyFileContent)
if err != nil {
return types.AuthConfig{}
return registry.AuthConfig{}
}
return types.AuthConfig{Username: "_json_key", Password: string(decoded)}
return registry.AuthConfig{Username: "_json_key", Password: string(decoded)}
}

func (r *GCR) GetAuthInfo() string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/gcr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"testing"

"github.com/apex/log"
"github.com/docker/docker/api/types"
types "github.com/docker/docker/api/types/registry"
"github.com/stretchr/testify/assert"
mocks "gitlab.com/unboundsoftware/apex-mocks"

Expand Down
8 changes: 4 additions & 4 deletions pkg/registry/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"fmt"

"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"

"github.com/buildtool/build-tools/pkg/docker"
)
Expand All @@ -53,7 +53,7 @@ func (r Github) Configured() bool {
}

func (r Github) Login(client docker.Client) error {
if ok, err := client.RegistryLogin(context.Background(), types.AuthConfig{Username: r.Username, Password: r.password(), ServerAddress: "ghcr.io"}); err == nil {
if ok, err := client.RegistryLogin(context.Background(), registry.AuthConfig{Username: r.Username, Password: r.password(), ServerAddress: "ghcr.io"}); err == nil {
log.Debugf("%s\n", ok.Status)
return nil
} else {
Expand All @@ -67,8 +67,8 @@ func (r Github) password() string {
}
return r.Password
}
func (r Github) GetAuthConfig() types.AuthConfig {
return types.AuthConfig{Username: r.Username, Password: r.password(), ServerAddress: "ghcr.io"}
func (r Github) GetAuthConfig() registry.AuthConfig {
return registry.AuthConfig{Username: r.Username, Password: r.password(), ServerAddress: "ghcr.io"}
}

func (r Github) GetAuthInfo() string {
Expand Down
6 changes: 3 additions & 3 deletions pkg/registry/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"strings"

"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"

"github.com/buildtool/build-tools/pkg/docker"
)
Expand Down Expand Up @@ -61,8 +61,8 @@ func (r Gitlab) Login(client docker.Client) error {
}
}

func (r Gitlab) GetAuthConfig() types.AuthConfig {
return types.AuthConfig{Username: r.User, Password: r.Token, ServerAddress: r.Registry}
func (r Gitlab) GetAuthConfig() registry.AuthConfig {
return registry.AuthConfig{Username: r.User, Password: r.Token, ServerAddress: r.Registry}
}

func (r Gitlab) GetAuthInfo() string {
Expand Down
6 changes: 3 additions & 3 deletions pkg/registry/no.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"fmt"

"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"

"github.com/buildtool/build-tools/pkg/docker"
)
Expand All @@ -46,8 +46,8 @@ func (n NoDockerRegistry) Login(client docker.Client) error {
return nil
}

func (n NoDockerRegistry) GetAuthConfig() types.AuthConfig {
return types.AuthConfig{}
func (n NoDockerRegistry) GetAuthConfig() registry.AuthConfig {
return registry.AuthConfig{}
}

func (n NoDockerRegistry) GetAuthInfo() string {
Expand Down
6 changes: 3 additions & 3 deletions pkg/registry/quay.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"fmt"

"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"

"github.com/buildtool/build-tools/pkg/docker"
)
Expand Down Expand Up @@ -60,8 +60,8 @@ func (r *Quay) Login(client docker.Client) error {
}
}

func (r Quay) GetAuthConfig() types.AuthConfig {
return types.AuthConfig{Username: r.Username, Password: r.Password, ServerAddress: "quay.io"}
func (r Quay) GetAuthConfig() registry.AuthConfig {
return registry.AuthConfig{Username: r.Username, Password: r.Password, ServerAddress: "quay.io"}
}

func (r Quay) GetAuthInfo() string {
Expand Down
3 changes: 2 additions & 1 deletion pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"

"github.com/buildtool/build-tools/pkg/docker"
)
Expand All @@ -38,7 +39,7 @@ type Registry interface {
Configured() bool
Name() string
Login(client docker.Client) error
GetAuthConfig() types.AuthConfig
GetAuthConfig() registry.AuthConfig
GetAuthInfo() string
RegistryUrl() string
Create(repository string) error
Expand Down

0 comments on commit 5b5097d

Please sign in to comment.