|
|
@@ -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.
|