common

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoPassword is returned if the user did not supply a password
	ErrNoPassword = errors.Wrapf(syscall.EINVAL, "password was not supplied")
)

Functions

func CopyStringStringMap

func CopyStringStringMap(m map[string]string) map[string]string

CopyStringStringMap deep copies a map[string]string and returns the result

func GetCopyOptions

func GetCopyOptions(reportWriter io.Writer, signaturePolicyPath string, srcDockerRegistry, destDockerRegistry *DockerRegistryOptions, signing SigningOptions) *cp.Options

GetCopyOptions constructs a new containers/image/copy.Options{} struct from the given parameters

func GetPolicyContext

func GetPolicyContext(path string) (*signature.PolicyContext, error)

GetPolicyContext creates a signature policy context for the given signature policy path

func GetSystemContext

func GetSystemContext(signaturePolicyPath, authFilePath string) *types.SystemContext

GetSystemContext Constructs a new containers/image/types.SystemContext{} struct from the given signaturePolicy path

func IsFalse

func IsFalse(str string) bool

IsFalse determines whether the given string equals "false"

func IsTrue

func IsTrue(str string) bool

IsTrue determines whether the given string equals "true"

func IsValidBool

func IsValidBool(str string) bool

IsValidBool determines whether the given string equals "true" or "false"

func ParseRegistryCreds

func ParseRegistryCreds(creds string) (*types.DockerAuthConfig, error)

ParseRegistryCreds takes a credentials string in the form USERNAME:PASSWORD and returns a DockerAuthConfig

Types

type DockerRegistryOptions

type DockerRegistryOptions struct {
	// DockerRegistryCreds is the user name and password to supply in case
	// we need to pull an image from a registry, and it requires us to
	// authenticate.
	DockerRegistryCreds *types.DockerAuthConfig
	// DockerCertPath is the location of a directory containing CA
	// certificates which will be used to verify the registry's certificate
	// (all files with names ending in ".crt"), and possibly client
	// certificates and private keys (pairs of files with the same name,
	// except for ".cert" and ".key" suffixes).
	DockerCertPath string
	// DockerInsecureSkipTLSVerify turns off verification of TLS
	// certificates and allows connecting to registries without encryption.
	DockerInsecureSkipTLSVerify bool
}

DockerRegistryOptions encapsulates settings that affect how we connect or authenticate to a remote registry.

func (DockerRegistryOptions) GetSystemContext

func (o DockerRegistryOptions) GetSystemContext(signaturePolicyPath string) *types.SystemContext

GetSystemContext constructs a new system context from the given signaturePolicy path and the values in the DockerRegistryOptions

type SigningOptions

type SigningOptions struct {
	// RemoveSignatures directs us to remove any signatures which are already present.
	RemoveSignatures bool
	// SignBy is a key identifier of some kind, indicating that a signature should be generated using the specified private key and stored with the image.
	SignBy string
}

SigningOptions encapsulates settings that control whether or not we strip or add signatures to images when writing them.

Jump to

Keyboard shortcuts

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