...

Package image

Overview ▾

image package provides functions to work with Components of type Image declared in the devfile

Package image is a generated GoMock package.

func BuildPushImages

func BuildPushImages(ctx context.Context, backend Backend, fs filesystem.Filesystem, push bool) error

BuildPushImages build all images defined in the devfile with the detected backend If push is true, also push the images to their registries

func BuildPushSpecificImage

func BuildPushSpecificImage(ctx context.Context, backend Backend, fs filesystem.Filesystem, component devfile.Component, push bool) error

BuildPushSpecificImage build an image defined in the devfile present in devfilePath If push is true, also push the image to its registry

type Backend

Backend is in interface that must be implemented by container runtimes

type Backend interface {
    // Build the image as defined in the devfile.
    // The filesystem specified will be used to download and store the Dockerfile if it is referenced as a remote URL.
    Build(fs filesystem.Filesystem, image *devfile.ImageComponent, devfilePath string) error
    // Push the image to its registry as defined in the devfile
    Push(image string) error
    // Return the name of the backend
    String() string
}

func SelectBackend

func SelectBackend(ctx context.Context) Backend

SelectBackend selects the container backend to use for building and pushing images It will detect podman and docker CLIs (in this order), or return nil if none are present locally

type DockerCompatibleBackend

DockerCompatibleBackend uses a CLI compatible with the docker CLI (at least docker itself and podman)

type DockerCompatibleBackend struct {
    // contains filtered or unexported fields
}

func NewDockerCompatibleBackend

func NewDockerCompatibleBackend(name string, globalExtraArgs, imageBuildExtraArgs []string) *DockerCompatibleBackend

func (*DockerCompatibleBackend) Build

func (o *DockerCompatibleBackend) Build(fs filesystem.Filesystem, image *devfile.ImageComponent, devfilePath string) error

Build an image, as defined in devfile, using a Docker compatible CLI

func (*DockerCompatibleBackend) Push

func (o *DockerCompatibleBackend) Push(image string) error

Push an image to its registry using a Docker compatible CLI

func (*DockerCompatibleBackend) String

func (o *DockerCompatibleBackend) String() string

String return the name of the docker compatible CLI used

type MockBackend

MockBackend is a mock of Backend interface.

type MockBackend struct {
    // contains filtered or unexported fields
}

func NewMockBackend

func NewMockBackend(ctrl *gomock.Controller) *MockBackend

NewMockBackend creates a new mock instance.

func (*MockBackend) Build

func (m *MockBackend) Build(fs filesystem.Filesystem, image *v1alpha2.ImageComponent, devfilePath string) error

Build mocks base method.

func (*MockBackend) EXPECT

func (m *MockBackend) EXPECT() *MockBackendMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBackend) Push

func (m *MockBackend) Push(image string) error

Push mocks base method.

func (*MockBackend) String

func (m *MockBackend) String() string

String mocks base method.

type MockBackendMockRecorder

MockBackendMockRecorder is the mock recorder for MockBackend.

type MockBackendMockRecorder struct {
    // contains filtered or unexported fields
}

func (*MockBackendMockRecorder) Build

func (mr *MockBackendMockRecorder) Build(fs, image, devfilePath interface{}) *gomock.Call

Build indicates an expected call of Build.

func (*MockBackendMockRecorder) Push

func (mr *MockBackendMockRecorder) Push(image interface{}) *gomock.Call

Push indicates an expected call of Push.

func (*MockBackendMockRecorder) String

func (mr *MockBackendMockRecorder) String() *gomock.Call

String indicates an expected call of String.