tag

package
v1.39.12 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateComponents

func CreateComponents(runCtx *runcontext.RunContext, t *latest.CustomTemplateTagger) (map[string]Tagger, error)

CreateComponents creates a map of taggers for CustomTemplateTagger

func ExecuteCustomTemplate

func ExecuteCustomTemplate(customTemplate *template.Template, customMap map[string]string) (string, error)

ExecuteCustomTemplate executes a customTemplate against a custom map.

func GenerateFullyQualifiedImageName

func GenerateFullyQualifiedImageName(ctx context.Context, t Tagger, image latest.Artifact) (string, error)

GenerateFullyQualifiedImageName resolves the fully qualified image name for an artifact. The workingDir is the root directory of the artifact with respect to the Skaffold root, and imageName is the base name of the image.

func ParseCustomTemplate

func ParseCustomTemplate(t string) (*template.Template, error)

ParseCustomTemplate is a simple wrapper to parse an custom template.

Types

type ChecksumTagger

type ChecksumTagger struct{}

ChecksumTagger tags an image by the sha256 of the image tarball

func (*ChecksumTagger) GenerateTag

func (t *ChecksumTagger) GenerateTag(ctx context.Context, image latest.Artifact) (string, error)

GenerateTag returns either the current tag or `latest`.

type CustomTag

type CustomTag struct {
	Tag string
}

func (*CustomTag) GenerateTag

func (t *CustomTag) GenerateTag(ctx context.Context, image latest.Artifact) (string, error)

GenerateTag generates a tag using the custom tag.

type GitCommit

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

GitCommit tags an image by the git commit it was built at.

func NewGitCommit

func NewGitCommit(prefix, variant string, ignoreChanges bool) (*GitCommit, error)

NewGitCommit creates a new git commit tagger. It fails if the tagger variant is invalid.

func (*GitCommit) GenerateTag

func (t *GitCommit) GenerateTag(ctx context.Context, image latest.Artifact) (string, error)

GenerateTag generates a tag from the git commit.

type ImageTags

type ImageTags map[string]string

ImageTags maps image names to tags

type Tagger

type Tagger interface {
	// GenerateTag generates a tag for an artifact.
	GenerateTag(ctx context.Context, image latest.Artifact) (string, error)
}

Tagger is an interface for tag strategies to be implemented against

func NewCustomTemplateTagger

func NewCustomTemplateTagger(t string, components map[string]Tagger) (Tagger, error)

NewCustomTemplateTagger creates a new customTemplateTagger

func NewDateTimeTagger

func NewDateTimeTagger(format, timezone string) Tagger

NewDateTimeTagger creates a tagger from a date format and timezone.

func NewEnvTemplateTagger

func NewEnvTemplateTagger(t string) (Tagger, error)

NewEnvTemplateTagger creates a new envTemplateTagger

func NewInputDigestTagger added in v1.22.0

func NewInputDigestTagger(cfg docker.Config, ag graph.ArtifactGraph) (Tagger, error)

func NewTaggerMux

func NewTaggerMux(runCtx *runcontext.RunContext) (Tagger, error)

type TaggerMux

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

func (*TaggerMux) GenerateTag

func (t *TaggerMux) GenerateTag(ctx context.Context, image latest.Artifact) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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