Jelajahi Sumber

remove custom docker client from pack client

Alexander Belanger 4 tahun lalu
induk
melakukan
4cecff1b07
2 mengubah file dengan 1 tambahan dan 24 penghapusan
  1. 0 23
      cli/cmd/docker/agent.go
  2. 1 1
      cli/cmd/pack/pack.go

+ 0 - 23
cli/cmd/docker/agent.go

@@ -6,7 +6,6 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
-	"io"
 	"net/http"
 	"os"
 	"strings"
@@ -33,28 +32,6 @@ type Agent struct {
 	label      string
 }
 
-// ImagePull overrides the default docker client ImagePull to inject registry credentials
-func (a *Agent) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) {
-	opts, err := a.getPullOptions(refStr)
-
-	if err != nil {
-		return a.Client.ImagePull(ctx, refStr, options)
-	}
-
-	return a.Client.ImagePull(ctx, refStr, opts)
-}
-
-// ImagePush overrides the default docker client ImagePush to inject registry credentials
-func (a *Agent) ImagePush(ctx context.Context, image string, options types.ImagePushOptions) (io.ReadCloser, error) {
-	opts, err := a.getPushOptions(image)
-
-	if err != nil {
-		return a.Client.ImagePush(ctx, image, options)
-	}
-
-	return a.Client.ImagePush(ctx, image, opts)
-}
-
 // CreateLocalVolumeIfNotExist creates a volume using driver type "local" with the
 // given name if it does not exist. If the volume does exist but does not contain
 // the required label (a.label), an error is thrown.

+ 1 - 1
cli/cmd/pack/pack.go

@@ -25,7 +25,7 @@ func (a *Agent) Build(opts *docker.BuildOpts, buildConfig *types.BuildConfig, dc
 	//initialize a pack client
 	logger := newPackLogger()
 
-	client, err := packclient.NewClient(packclient.WithLogger(logger), packclient.WithDockerClient(dc))
+	client, err := packclient.NewClient(packclient.WithLogger(logger))
 
 	if err != nil {
 		return err