entrypoint

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MountName is the name of the pvc being mounted (which
	// will contain the entrypoint binary and eventually the logs)
	MountName         = "tools"
	MountPoint        = "/tools"
	BinaryLocation    = MountPoint + "/entrypoint"
	JSONConfigEnvVar  = "ENTRYPOINT_OPTIONS"
	InitContainerName = "place-tools"
	ProcessLogFile    = "/tools/process-log.txt"
	MarkerFile        = "/tools/marker-file.txt"
)

Variables

This section is empty.

Functions

func AddCopyStep

func AddCopyStep(ctx context.Context, b *v1alpha1.BuildSpec)

AddCopyStep will prepend a BuildStep (Container) that will copy the entrypoint binary from the entrypoint image into the volume mounted at MountPoint, so that it can be mounted by subsequent steps and used to capture logs.

func GetImageDigest

func GetImageDigest(cache *Cache, image string) (string, error)

GetImageDigest tries to find and return image digest in cache, if cache doesn't exists it will lookup the digest in remote image manifest and then cache it

func GetRemoteEntrypoint

func GetRemoteEntrypoint(cache *Cache, digest string) ([]string, error)

GetRemoteEntrypoint accepts a cache of digest lookups, as well as the digest to look for. If the cache does not contain the digest, it will lookup the metadata from the images registry, and then commit that to the cache

func RedirectSteps

func RedirectSteps(steps []corev1.Container) error

RedirectSteps will modify each of the steps/containers such that the binary being run is no longer the one specified by the Command and the Args, but is instead the entrypoint binary, which will itself invoke the Command and Args, but also capture logs.

Types

type Cache

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

Cache is a simple caching mechanism allowing for caching the results of getting the Entrypoint of a container image from a remote registry. The internal lru cache is thread-safe.

func NewCache

func NewCache() (*Cache, error)

NewCache is a simple helper function that returns a pointer to a Cache that has had the internal fixed-sized lru cache initialized.

Jump to

Keyboard shortcuts

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