image

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnsiblePlaybookDriverName is the name of the driver
	AnsiblePlaybookDriverName = "ansible-playbook"
	// DockerDriverName is the name of the docekr driver
	DockerDriverName = "docker"
	// DryRunDriverName is the name of the dry run driver
	DryRunDriverName = "dry-run"
	// DefaultDriverName is the name of the dry run driver
	DefaultDriverName = "default"
	// MockDriverName is the name of the mock driver
	MockDriverName = "mock"
)
View Source
const (
	// ImageWildcardVersionSymbol is the wildcard version
	ImageWildcardVersionSymbol = "*"
	// NameFilterAttribute is the attribute's filter value to filter by name
	NameFilterAttribute = "name"
	// VersionFilterAttribute is the attribute's filter value to filter by version
	VersionFilterAttribute = "version"
	// RegistryHostFilterAttribute is the attribute's filter value to filter by registry host
	RegistryHostFilterAttribute = "registry"
	// RegistryNamespaceFilterAttribute is the attribute's filter value to filter by namespace
	RegistryNamespaceFilterAttribute = "namespace"
	// UndefinedStringValue defines an empty value rather that and empty string
	UndefinedStringValue = "-"
)
View Source
const (
	// DockerDriverName is the name for the docker promoter
	DockerPromoterName = "docker"
	// DryRunPromoterName is the name for the dry run promoter
	DryRunPromoterName = "dry-run"
	// MockPromoterName is the name for the mock promoter
	MockPromoterName = "mock"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildDriverOptions

type BuildDriverOptions struct {
	// AnsibleConnectionLocal is the local connection to use on ansible driver
	AnsibleConnectionLocal bool `yaml:"ansible_connection_local"`
	// AnsibleIntermediateContainerName is the name of an intermediate container that can be used during ansible build process
	AnsibleIntermediateContainerName string `yaml:"ansible_intermediate_container_name"`
	// AnsibleInventoryPath is the path to the ansible inventory file ??
	AnsibleInventoryPath string `yaml:"ansible_inventory_path"`
	// AnsibleLimit is the ansible limit ??
	AnsibleLimit string `yaml:"ansible_limit"`
	// BuilderOptions are those options comming from builder
	BuilderOptions *builder.BuilderOptions `yaml:"builder_options"`
	// BuilderVarMappings are those variables name that will be automatically generated by builder and set to the driver for building the image
	BuilderVarMappings map[string]string `yaml:"builder_variables_mapping"`
	// OutputPrefix prefixes each output line
	OutputPrefix string `yaml:"output_prefix"`
	// PullAuthUsername is the username to use for pulling the image
	PullAuthUsername string `yaml:"pull_auth_username"`
	// PullAuthPassword is the password to use for pulling the image
	PullAuthPassword string `yaml:"-"`
	// PullParentImage indicates whether to pull the parent image
	PullParentImage bool `yaml:"pull_parent_image"`
	// PushAuthUsername is the username to use for pushing the image
	PushAuthUsername string `yaml:"push_auth_username"`
	// PushAuthPassword is the password to use for pushing the image
	PushAuthPassword string `yaml:"-"`
	// PushImageAfterBuild flag indicate whether to push the image to the registry once it has been built
	PushImageAfterBuild bool `yaml:"push_image_after_build"`
	// RemoveImageAfterBuild flag indicate whether to remove the image after build
	RemoveImageAfterBuild bool `yaml:"remove_image_after_build"`
}

BuildDriverOptions options required by driver to build an image

func (*BuildDriverOptions) String

func (o *BuildDriverOptions) String() string

String TODO

type Image

type Image struct {
	// Builder is the builder to use to build the image
	Builder interface{} `yaml:"builder"`
	// Children list of children images
	Children []*Image `yaml:"-"`
	// Labels is a map of image labels
	Labels map[string]string `yaml:"labels"`
	// Name is the name of the image
	Name string `yaml:"name"`
	// Parent is the parent image
	Parent *Image `yaml:"-"`
	// PersistentLabels persistent labels
	PersistentLabels map[string]string `yaml:"persistent_labels"`
	// PresistentVars are persistent variables
	PersistentVars map[string]interface{} `yaml:"persistent_vars"`
	// RegistryHost is the host of the registry
	RegistryHost string `yaml:"registry_host"`
	// RegistryNamespace is the namespace of the registry
	RegistryNamespace string `yaml:"registry_namespace"`
	// Tags is a list of extra tags
	Tags []string `yaml:"tags"`
	// Vars is a map of variables
	Vars map[string]interface{} `yaml:"vars"`
	// Version is the version of the image
	Version string `yaml:"version"`
	// contains filtered or unexported fields
}

Image defines the image on the system

func NewImage

func NewImage(name, version, registryHost, registryNamesapace string, opt ...OptionFunc) (*Image, error)

NewImage creates a new image

func Parse

func Parse(name string) (*Image, error)

Parse generates an image skeleton using a docker images name passed as parameter

func (*Image) AddChild

func (i *Image) AddChild(child *Image)

AddChild adds a child image

func (*Image) Copy

func (i *Image) Copy() (*Image, error)

Copy method return a copy of the instanced Image

func (*Image) IsWildcardImage

func (i *Image) IsWildcardImage() bool

IsWildcardImage returns true if the image is a wildcard image

func (*Image) Options

func (i *Image) Options(o ...OptionFunc)

Options returns the options of the image

func (*Image) Sanetize

func (i *Image) Sanetize() error

Sanetize normalizes the image name

func (*Image) YAMLMarshal

func (i *Image) YAMLMarshal() ([]byte, error)

YAMLMarshal marshals the image to YAML

func (*Image) YAMLUnmarshal

func (i *Image) YAMLUnmarshal(in []byte) error

YAMLUnmarshal unmarshals the image from a YAML string

type OptionFunc

type OptionFunc func(*Image)

OptionFunc is an option to pass to NewImage

func WithBuilder

func WithBuilder(builder interface{}) OptionFunc

WithBuilder sets the builder

func WithChildren

func WithChildren(children ...*Image) OptionFunc

WithChildren sets the children

func WithLabels

func WithLabels(labels map[string]string) OptionFunc

WithLabels sets the labels

func WithParent

func WithParent(parent *Image) OptionFunc

WithParent sets the parent image

func WithPersistentLabels

func WithPersistentLabels(persistentLabels map[string]string) OptionFunc

WithPersistentLabels sets the persistent variables

func WithPersistentVars

func WithPersistentVars(persistentVars map[string]interface{}) OptionFunc

WithPersistentVars sets the persistent variables

func WithTags

func WithTags(tags ...string) OptionFunc

WithTags sets the tags

func WithVars

func WithVars(vars map[string]interface{}) OptionFunc

WithVars sets the variables

type PromoteOptions

type PromoteOptions struct {
	// TargetImageName is the target image name
	TargetImageName string `yaml:"target_image_name"`
	// TargetImageTags list of extra tags for the target image
	TargetImageTags []string `yaml:"target_image_tags"`
	// RemoveTargetImageTags flag removes all images from local host once the image is promoted
	RemoveTargetImageTags bool `yaml:"remove_local_images_after_push"`
	// RemoteSourceImage flag use an image from remote source
	RemoteSourceImage bool `yaml:"use_image_from_remote_source"`
	// SourceImageName is the source image name
	SourceImageName string `yaml:"source_image_name"`
	// PullAuthUsername
	PullAuthUsername string `yaml:"pull_auth_username"`
	// PullAuthPassword
	PullAuthPassword string `yaml:"-"`
	// PushAuthUsername
	PushAuthUsername string `yaml:"push_auth_username"`
	// PushAuthPassword
	PushAuthPassword string `yaml:"-"`
}

PromoteOptions

func (*PromoteOptions) String

func (o *PromoteOptions) String() string

String TODO

Jump to

Keyboard shortcuts

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