From d7c32450a42a8271111fa363aa4b0364b7b0b8cd Mon Sep 17 00:00:00 2001 From: Matthias Bertschy Date: Tue, 30 Jan 2024 18:22:45 +0100 Subject: [PATCH] bump docker/docker dependency Signed-off-by: Matthias Bertschy --- go.mod | 2 +- go.sum | 4 ++-- secrethandling/inclustersecrethandling.go | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 58b6473..04873a2 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/armosec/armoapi-go v0.0.234 github.com/armosec/utils-go v0.0.20 - github.com/docker/docker v24.0.5+incompatible + github.com/docker/docker v25.0.1+incompatible github.com/francoispqt/gojay v1.2.13 github.com/olvrng/ujson v1.1.0 github.com/spf13/viper v1.7.0 diff --git a/go.sum b/go.sum index 9253f00..f586df0 100644 --- a/go.sum +++ b/go.sum @@ -123,8 +123,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/docker/docker v24.0.5+incompatible h1:WmgcE4fxyI6EEXxBRxsHnZXrO1pQ3smi0k/jho4HLeY= -github.com/docker/docker v24.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA= +github.com/docker/docker v25.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-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= diff --git a/secrethandling/inclustersecrethandling.go b/secrethandling/inclustersecrethandling.go index 0fdd8b6..c894cf5 100644 --- a/secrethandling/inclustersecrethandling.go +++ b/secrethandling/inclustersecrethandling.go @@ -7,16 +7,16 @@ import ( "fmt" "strings" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/registry" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" ) // DockerConfigJsonstructure - -type DockerConfigJsonstructure map[string]map[string]types.AuthConfig +type DockerConfigJsonstructure map[string]map[string]registry.AuthConfig -func updateSecret(authConfig *types.AuthConfig, serverAddress string) { +func updateSecret(authConfig *registry.AuthConfig, serverAddress string) { if authConfig.ServerAddress == "" { authConfig.ServerAddress = serverAddress } @@ -55,14 +55,14 @@ func parseDecodedSecret(sec map[string]string) (string, string) { } // ReadSecret - -func ReadSecret(secret interface{}, secretName string) (types.AuthConfig, error) { +func ReadSecret(secret interface{}, secretName string) (registry.AuthConfig, error) { // Store secret based on it's structure - var authConfig types.AuthConfig - if sec, ok := secret.(*types.AuthConfig); ok { + var authConfig registry.AuthConfig + if sec, ok := secret.(*registry.AuthConfig); ok { return *sec, nil } if sec, ok := secret.(map[string]string); ok { - return types.AuthConfig{Username: sec["username"]}, nil + return registry.AuthConfig{Username: sec["username"]}, nil } if sec, ok := secret.(DockerConfigJsonstructure); ok { if _, k := sec["auths"]; !k { @@ -77,7 +77,7 @@ func ReadSecret(secret interface{}, secretName string) (types.AuthConfig, error) return authConfig, fmt.Errorf("cant find secret") } -func GetSecret(clientset *kubernetes.Clientset, namespace, name string) (*types.AuthConfig, error) { +func GetSecret(clientset *kubernetes.Clientset, namespace, name string) (*registry.AuthConfig, error) { res, err := clientset.CoreV1().Secrets(namespace).Get(context.Background(), name, metav1.GetOptions{}) if err != nil { return nil, err @@ -131,11 +131,11 @@ func GetSecretContent(secret *corev1.Secret) (interface{}, error) { return nil, fmt.Errorf("username or password not found") } - return &types.AuthConfig{Username: user, Password: psw}, nil + return ®istry.AuthConfig{Username: user, Password: psw}, nil } } -func ParseSecret(res *corev1.Secret, name string) (*types.AuthConfig, error) { +func ParseSecret(res *corev1.Secret, name string) (*registry.AuthConfig, error) { // Read secret secret, err := GetSecretContent(res)