docker

package
v1.1.1-0...-9418116 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllAuthConfigs

func GetAllAuthConfigs() (map[string]types.AuthConfig, error)

GetAllAuthConfigs returns every auth config found in the docker config

func SetFakeClient

func SetFakeClient(fake Client)

SetFakeClient causes NewClient to return the given fake client. !ONLY FOR TESTING!

Types

type Client

type Client interface {
	Ping(ctx context.Context) (dockertypes.Ping, error)
	NegotiateAPIVersion(ctx context.Context)

	ImageBuild(ctx context.Context, context io.Reader, options dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error)
	ImageBuildCLI(useBuildkit bool, context io.Reader, writer io.Writer, options dockertypes.ImageBuildOptions) error

	ImagePush(ctx context.Context, ref string, options dockertypes.ImagePushOptions) (io.ReadCloser, error)

	Login(registryURL, user, password string, checkCredentialsStore, saveAuthConfig, relogin bool) (*dockertypes.AuthConfig, error)
	GetAuthConfig(registryURL string, checkCredentialsStore bool) (*dockertypes.AuthConfig, error)

	DeleteImageByName(imageName string, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)
	DeleteImageByFilter(filter filters.Args, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)
}

Client contains all functions required to interact with docker

func NewClient

func NewClient(log log.Logger) (Client, error)

NewClient retrieves a new docker client

func NewClientWithMinikube

func NewClientWithMinikube(currentKubeContext string, preferMinikube bool, log log.Logger) (Client, error)

NewClientWithMinikube creates a new docker client with optionally from the minikube vm

type FakeClient

type FakeClient struct {
	AuthConfig *dockertypes.AuthConfig
}

FakeClient is a prototype for a fake docker cient for testing purposes

func (*FakeClient) DeleteImageByFilter

func (client *FakeClient) DeleteImageByFilter(filter filters.Args, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)

DeleteImageByFilter is a fake implementation

func (*FakeClient) DeleteImageByName

func (client *FakeClient) DeleteImageByName(imageName string, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)

DeleteImageByName is a fake implementation

func (*FakeClient) GetAuthConfig

func (client *FakeClient) GetAuthConfig(registryURL string, checkCredentialsStore bool) (*dockertypes.AuthConfig, error)

GetAuthConfig is a fake implementation

func (*FakeClient) ImageBuild

func (client *FakeClient) ImageBuild(ctx context.Context, context io.Reader, options dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error)

ImageBuild is a fake implementation

func (*FakeClient) ImageBuildCLI

func (client *FakeClient) ImageBuildCLI(useBuildkit bool, context io.Reader, writer io.Writer, options dockertypes.ImageBuildOptions) error

ImageBuildCLI builds an image with the docker cli

func (*FakeClient) ImagePush

func (client *FakeClient) ImagePush(ctx context.Context, ref string, options dockertypes.ImagePushOptions) (io.ReadCloser, error)

ImagePush is a fake implementation

func (*FakeClient) Login

func (client *FakeClient) Login(registryURL, user, password string, checkCredentialsStore, saveAuthConfig, relogin bool) (*dockertypes.AuthConfig, error)

Login is a fake implementation

func (*FakeClient) NegotiateAPIVersion

func (client *FakeClient) NegotiateAPIVersion(ctx context.Context)

NegotiateAPIVersion is a fake implementation

func (*FakeClient) Ping

func (client *FakeClient) Ping(ctx context.Context) (dockertypes.Ping, error)

Ping is a fake implementation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL