manifest

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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"`
}

A 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 New

func New(host string, repository string) Manifest

New returns an empty Manifest with the target set to the specified host and repository.

func NewWithAutodetect

func NewWithAutodetect(host string, repository string, path string) (Manifest, error)

NewWithAutodetect returns a manifest populated with the images found at the specified path. The target of the manifest will be set to the specified host and repository.

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 GetImagesFromKubernetesManifests

func GetImagesFromKubernetesManifests(path string, target Target) ([]Source, error)

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

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