manifest

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImagesFromKubernetesManifests

func GetImagesFromKubernetesManifests(path string) ([]string, error)

GetImagesFromKubernetesManifests returns all images found in Kubernetes manifests that are located at the specified path.

func GetImagesFromKubernetesResources added in v0.11.2

func GetImagesFromKubernetesResources(resources []string) ([]string, error)

GetImagesFromKubernetesResources returns all images found in Kubernetes resources that have already been read from the disk, or are being read from standard input.

func GetImagesFromStandardInput added in v0.11.0

func GetImagesFromStandardInput() ([]string, error)

GetImagesFromStandardInput gets a list of images passed in by standard input.

Types

type Auth

type Auth struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

Auth is a username and password to authenticate to a registry.

type Manifest

type Manifest struct {
	Target  Target   `yaml:"target"`
	Sources []Source `yaml:"sources,omitempty"`
}

Manifest contains all of the sources to push to a target registry.

func Get

func Get(path string) (Manifest, error)

Get returns the manifest found at the specified path.

func (Manifest) Update added in v0.11.0

func (m Manifest) Update(images []string) Manifest

func (Manifest) Write

func (m Manifest) Write(path string) error

Write writes the contents of the manifest to disk at the specified path.

type Source

type Source struct {
	Repository string `yaml:"repository"`
	Host       string `yaml:"host,omitempty"`
	Target     Target `yaml:"target,omitempty"`
	Tag        string `yaml:"tag,omitempty"`
	Digest     string `yaml:"digest,omitempty"`
	Auth       Auth   `yaml:"auth,omitempty"`
}

Source is a container image in the manifest.

func GetSourcesFromImages

func GetSourcesFromImages(images []string, target string) []Source

GetSourcesFromImages returns the given images as sources with the specified target.

func (Source) EncodedAuth

func (s Source) EncodedAuth() (string, error)

EncodedAuth returns the Base64 encoded auth for the source registry.

func (Source) Image

func (s Source) Image() string

Image returns the source image including its tag or digest.

func (Source) TargetImage

func (s Source) TargetImage() string

TargetImage returns the target image including its tag or digest.

type Target

type Target struct {
	Host       string `yaml:"host,omitempty"`
	Repository string `yaml:"repository,omitempty"`
	Auth       Auth   `yaml:"auth,omitempty"`
}

Target is the target registry where the images defined in the manifest will be pushed to.

func (Target) EncodedAuth

func (t Target) EncodedAuth() (string, error)

EncodedAuth returns the Base64 encoded auth for the target registry.

Jump to

Keyboard shortcuts

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