promote

package
v0.11.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

Application is the application used to promote images

func NewApplication

func NewApplication(options ...OptionsFunc) *Application

NewApplication creates an application

func (*Application) Options

func (a *Application) Options(opts ...OptionsFunc)

Options configure the application

func (*Application) Promote

func (a *Application) Promote(ctx context.Context, options *Options) error

Promote method carries out the application tasks

type MockApplication

type MockApplication struct {
	mock.Mock
}

func NewMockApplication

func NewMockApplication() *MockApplication

func (*MockApplication) Promote

func (p *MockApplication) Promote(ctx context.Context, options *Options) error

type Options

type Options struct {
	// DryRun is a flag to indicate if the promote should be a dry run
	DryRun bool
	// EnableSemanticVersionTags flag generate semantic versioning tags when is true
	EnableSemanticVersionTags bool
	// TargetImageName is the target image name
	TargetImageName string
	// TargetImageRegistryNamespace is the target namespace name
	TargetImageRegistryNamespace string
	// TargetImageRegistryHost is the target registry host
	TargetImageRegistryHost string
	// TargetImageTags list of extra tags for the target image
	TargetImageTags []string
	// PromoteSourceImageTag push source image to registry
	PromoteSourceImageTag bool
	// RemoveTargetImageTags flag removes all images from local host once the image is promoted
	RemoveTargetImageTags bool
	// RemoteSourceImage flag indicates to use an image from remote source
	RemoteSourceImage bool
	// SourceImageName is the source image name
	SourceImageName string
	// SemanticVersionTagsTemplates is a list of templates to use to generate semantic version tags
	SemanticVersionTagsTemplates []string
}

type OptionsFunc

type OptionsFunc func(*Application)

OptionsFunc is a function used to configure the application

func WithCredentials

func WithCredentials(c repository.AuthFactorier) OptionsFunc

WitCredentials sets credentials for the application

func WithPromoteFactory

func WithPromoteFactory(f PromoteFactorier) OptionsFunc

WithPromoteFactory sets the factory used to create the promoter

func WithReferenceNamer

func WithReferenceNamer(ref repository.ImageReferenceNamer) OptionsFunc

WithReferenceNamer sets the reference namer component for the application

func WithSemver

func WithSemver(sv Semverser) OptionsFunc

WithSemver sets the semver component for the application

type Outputter

type Outputter interface {
	Info(msg ...interface{})
	Warn(msg ...interface{})
	Error(msg ...interface{})
}

Outputter

type PromoteFactorier

type PromoteFactorier interface {
	Get(string) (repository.Promoter, error)
	Register(id string, promoter repository.Promoter) error
}

PromoteFactorier

type Semverser

type Semverser interface {
	GenerateSemverList(version []string, tmpls []string) ([]string, error)
}

Semverser

Jump to

Keyboard shortcuts

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