Documentation ¶
Index ¶
- Constants
- type CommandRunner
- type ContainerCommandRunner
- func (r *ContainerCommandRunner) Build(dockerfile, tag string) error
- func (r *ContainerCommandRunner) GetToolName() string
- func (r *ContainerCommandRunner) Inspect(image string) ([]byte, error)
- func (r *ContainerCommandRunner) Pull(image string) error
- func (r *ContainerCommandRunner) Save(image, tarFile string) error
- type DockerConfig
- type DockerImageData
- type DockerfileGenerator
- type GetImageDataOption
- type GetImageDataOptions
- type ImageLabelReader
- type ImageLayerReader
- type ImageReader
- type IndexDockerfileGenerator
- type LabelReader
- type PodmanImageData
Constants ¶
const ( // Podman cli tool Podman = "podman" // Docker cli tool Docker = "docker" )
const ( DefaultDbLocation = "/database/index.db" DbLocationLabel = "operators.operatorframework.io.index.database.v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandRunner ¶
type CommandRunner interface { GetToolName() string Pull(image string) error Build(dockerfile, tag string) error Save(image, tarFile string) error Inspect(image string) ([]byte, error) }
CommandRunner defines methods to shell out to common container tools
func NewCommandRunner ¶
func NewCommandRunner(containerTool string, logger *logrus.Entry) CommandRunner
NewCommandRunner takes the containerTool as an input string and returns a CommandRunner to run commands with that cli tool
type ContainerCommandRunner ¶
type ContainerCommandRunner struct {
// contains filtered or unexported fields
}
ContainerCommandRunner is configured to select a container cli tool and execute commands with that tooling.
func (*ContainerCommandRunner) Build ¶
func (r *ContainerCommandRunner) Build(dockerfile, tag string) error
Build takes a dockerfile and a tag and builds a container image
func (*ContainerCommandRunner) GetToolName ¶
func (r *ContainerCommandRunner) GetToolName() string
GetToolName returns the container tool this command runner is using
func (*ContainerCommandRunner) Inspect ¶
func (r *ContainerCommandRunner) Inspect(image string) ([]byte, error)
Inspect runs the 'inspect' command to get image metadata of a local container image and returns a byte array of the command's output
func (*ContainerCommandRunner) Pull ¶
func (r *ContainerCommandRunner) Pull(image string) error
Pull takes a container image path hosted on a container registry and runs the pull command to download it onto the local environment
func (*ContainerCommandRunner) Save ¶ added in v1.5.4
func (r *ContainerCommandRunner) Save(image, tarFile string) error
Save takes a local container image and runs the save commmand to convert the image into a specified tarball and push it to the local directory
type DockerConfig ¶
type DockerImageData ¶
type DockerImageData struct {
Config DockerConfig `json:"Config"`
}
type DockerfileGenerator ¶
DockerfileGenerator defines functions to generate index dockerfiles
func NewDockerfileGenerator ¶
func NewDockerfileGenerator(containerTool string, logger *logrus.Entry) DockerfileGenerator
NewDockerfileGenerator is a constructor that returns a DockerfileGenerator
type GetImageDataOption ¶
type GetImageDataOption func(*GetImageDataOptions)
func WithWorkingDir ¶
func WithWorkingDir(workingDir string) GetImageDataOption
type GetImageDataOptions ¶
type GetImageDataOptions struct {
WorkingDir string
}
type ImageLabelReader ¶
type ImageLabelReader struct { Logger *logrus.Entry Cmd CommandRunner }
func (ImageLabelReader) GetLabelsFromImage ¶
func (r ImageLabelReader) GetLabelsFromImage(image string) (map[string]string, error)
GetLabelsFromImage takes a container image path as input, pulls that image to the local environment and then inspects it for labels
type ImageLayerReader ¶ added in v1.5.4
type ImageLayerReader struct { Cmd CommandRunner Logger *logrus.Entry }
func (ImageLayerReader) GetImageData ¶ added in v1.5.4
func (b ImageLayerReader) GetImageData(image, outputDir string, opts ...GetImageDataOption) error
type ImageReader ¶ added in v1.5.4
type ImageReader interface {
GetImageData(string, string, ...GetImageDataOption) error
}
func NewImageReader ¶ added in v1.5.4
func NewImageReader(containerTool string, logger *logrus.Entry) ImageReader
type IndexDockerfileGenerator ¶
IndexDockerfileGenerator struct implementation of DockerfileGenerator interface
func (*IndexDockerfileGenerator) GenerateIndexDockerfile ¶
func (g *IndexDockerfileGenerator) GenerateIndexDockerfile(binarySourceImage, databaseFolder string) string
GenerateIndexDockerfile builds a string representation of a dockerfile to use when building an operator-registry index image
type LabelReader ¶
func NewLabelReader ¶
func NewLabelReader(containerTool string, logger *logrus.Entry) LabelReader