cache

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashTag

func HashTag(a *latest.Artifact) string

Types

type ArtifactCache

type ArtifactCache map[string]ImageDetails

ArtifactCache is a map of [artifact dependencies hash : ImageDetails]

type Cache

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

Cache holds any data necessary for accessing the cache

func NewCache

func NewCache(builder build.Builder, runCtx *runcontext.RunContext) *Cache

NewCache returns the current state of the cache

func (*Cache) CacheArtifacts

func (c *Cache) CacheArtifacts(ctx context.Context, artifacts []*latest.Artifact, buildArtifacts []build.Artifact) error

CacheArtifacts determines the hash for each artifact, stores it in the artifact cache, and saves the cache at the end

func (*Cache) RetagLocalImages added in v0.26.0

func (c *Cache) RetagLocalImages(ctx context.Context, out io.Writer, artifactsToBuild []*latest.Artifact, buildArtifacts []build.Artifact)

Retag retags newly built images in the format [imageName:workspaceHash] and pushes them if using a remote cluster

func (*Cache) RetrieveCachedArtifacts

func (c *Cache) RetrieveCachedArtifacts(ctx context.Context, out io.Writer, artifacts []*latest.Artifact) ([]*latest.Artifact, []build.Artifact, error)

RetrieveCachedArtifacts checks to see if artifacts are cached, and returns tags for cached images, otherwise a list of images to be built

type ImageDetails

type ImageDetails struct {
	Digest string `yaml:"digest,omitempty"`
	ID     string `yaml:"id,omitempty"`
}

ImageDetails holds the Digest and ID of an image

Jump to

Keyboard shortcuts

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