internal

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TemplateRegex    = regexp.MustCompile(`{{\s*(.*?)\s*}}`)
	TagRegex         = regexp.MustCompile(`:{{\s*(.*?)\s*}}`)
	DigestRegex      = regexp.MustCompile(`@{{\s*(.*?)\s*}}`)
	TagOrDigestRegex = regexp.MustCompile(`[:|@]{{.*?}}`)
)

Functions

func NewCachedImage added in v0.3.58

func NewCachedImage(img v1.Image, dir string) v1.Image

NewCachedImage wraps a v1.Image, usually a remote one, so that layer downloads are cached at the given dir. Once the first download happens from an image layer, the next download won't happen and instead the layer is copied from that local directory cache.

Types

type CanonicalDockerImage added in v0.3.60

type CanonicalDockerImage struct {
	v1.Image
}

CanonicalDockerImage is an image which imageManifest has been modified (indented) to follow the same format used by docker during push [1] and hence preserve the digest once crafted and pushed from a tarball [1] https://github.com/docker/cli/blob/a32cd16160f1b41c1c4ae7bee4dac929d1484e59/cli/command/manifest/push.go#L230 It reimplements v1.Image https://github.com/google/go-containerregistry/blob/main/pkg/v1/image.go#L22

func NewCanonicalDockerImage added in v0.3.60

func NewCanonicalDockerImage(image v1.Image) *CanonicalDockerImage

NewCanonicalDockerImage returns an instance of the the image which imagemanifest comes indented

func (*CanonicalDockerImage) Digest added in v0.3.60

func (img *CanonicalDockerImage) Digest() (v1.Hash, error)

func (*CanonicalDockerImage) RawManifest added in v0.3.60

func (img *CanonicalDockerImage) RawManifest() ([]byte, error)

type ContainerRegistryClient added in v0.3.45

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

func NewContainerRegistryClient added in v0.3.45

func NewContainerRegistryClient(auth authn.Keychain) *ContainerRegistryClient

func (*ContainerRegistryClient) Check added in v0.3.45

func (i *ContainerRegistryClient) Check(digest string, imageReference name.Reference) (bool, error)

func (*ContainerRegistryClient) Pull added in v0.3.45

func (i *ContainerRegistryClient) Pull(imageReference name.Reference) (v1.Image, string, error)

func (*ContainerRegistryClient) Push added in v0.3.45

func (i *ContainerRegistryClient) Push(image v1.Image, dest name.Reference) error

type ContainerRegistryInterface added in v0.3.45

type ContainerRegistryInterface interface {
	Check(digest string, imageReference name.Reference) (bool, error)
	Pull(imageReference name.Reference) (v1.Image, string, error)
	Push(image v1.Image, dest name.Reference) error
}

type ImageChange

type ImageChange struct {
	Pattern            *ImageTemplate
	ImageReference     name.Reference
	RewrittenReference name.Reference
	Image              v1.Image
	Digest             string
	Tag                string
	AlreadyPushed      bool
}

func (*ImageChange) ShouldPush

func (change *ImageChange) ShouldPush() bool

type ImageTemplate

type ImageTemplate struct {
	Raw      string
	Template *template.Template

	RegistryTemplate              string
	RepositoryTemplate            string
	RegistryAndRepositoryTemplate string
	TagTemplate                   string
	DigestTemplate                string
}

func NewFromString

func NewFromString(input string) (*ImageTemplate, error)

func ParseImagePatterns

func ParseImagePatterns(patterns []byte) ([]*ImageTemplate, error)

func (*ImageTemplate) Apply

func (t *ImageTemplate) Apply(originalImage name.Repository, imageDigest string, rules *OCIImageLocation) ([]*RewriteAction, error)

func (*ImageTemplate) Render

func (t *ImageTemplate) Render(chart *chart.Chart, rewriteActions ...*RewriteAction) (name.Reference, error)

func (*ImageTemplate) String

func (t *ImageTemplate) String() string

type OCIImageLocation

type OCIImageLocation struct {
	Registry         string
	RepositoryPrefix string
}

type RewriteAction

type RewriteAction struct {
	Path  string `json:"path"`
	Value string `json:"value"`
}

func (*RewriteAction) Apply

func (a *RewriteAction) Apply(chart *chart.Chart) error

Apply will try to execute the rewrite action declaration on the given Helm Chart or sub-charts

func (*RewriteAction) FindChartDestination

func (a *RewriteAction) FindChartDestination(parentChart *chart.Chart) (*chart.Chart, *RewriteAction)

FindChartDestination will recursively find the Helm Chart a rewrite action will apply to by starting on a parentChart Additionally it will return the rewrite action with path relative to that Helm Chart

func (*RewriteAction) GetKey

func (a *RewriteAction) GetKey() string

func (*RewriteAction) GetPathToMap

func (a *RewriteAction) GetPathToMap() string

func (*RewriteAction) GetSubPathToMap

func (a *RewriteAction) GetSubPathToMap() string

func (*RewriteAction) ToMap

func (a *RewriteAction) ToMap() map[string]interface{}

func (*RewriteAction) TopLevelKey

func (a *RewriteAction) TopLevelKey() string

type ValuesMap

type ValuesMap map[string]interface{}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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