image

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoReplacementsMade = errors.New("no replacements made")
)

Functions

func DetermineMostGranularRepoTags

func DetermineMostGranularRepoTags(repoTags []string) string

func LoadImageRepoTags

func LoadImageRepoTags(fqnTagsPath string) ([]string, error)

func ReplaceImageReferences

func ReplaceImageReferences(contents []byte, oldRef string, newRef string) ([]byte, error)

func ReplaceImageReferencesForAliases added in v0.0.2

func ReplaceImageReferencesForAliases(contents []byte, newRef string, aliases ...string) ([]byte, error)

func TranslateUserProvidedRepoTags

func TranslateUserProvidedRepoTags(imageRepoTags []string, userProvidedRepoTags []string) []string

TranslateUserProvidedRepoTags translates user-provided repo tags into repo tags that are pushed:

- Support pushing by user-provided repository and tag:

`push index.docker.io/foo/bar:my-tag`

- Support pushing by user-provided repository, SBOM repository tags:

`push index.docker.io/foo/bar:`

- Support pushing by SBOM repository, user-provided tag:

`push :my-tag`

- Support pushing by user-provided registry, SBOM repository path and tags:

`push localhost:5000`

Types

type Pusher

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

func NewPusher

func NewPusher(opts *PusherOpts) *Pusher

func (*Pusher) PushTar

func (p *Pusher) PushTar(ctx context.Context, tarPath string, repoTags []string) error

type PusherOpts

type PusherOpts struct {
	CraneTool   string
	FQNTagsPath string
}

type RepoTag

type RepoTag string

func (RepoTag) GetPath

func (i RepoTag) GetPath() string

func (RepoTag) GetRegistry

func (i RepoTag) GetRegistry() string

func (RepoTag) GetRepository

func (i RepoTag) GetRepository() string

func (RepoTag) GetTag

func (i RepoTag) GetTag() string

Jump to

Keyboard shortcuts

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