entrypoint

package
v0.0.0-...-79fe4a6 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 10 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 GetRemoteEntrypoint

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

GetRemoteEntrypoint accepts a cache of image lookups, as well as the image to look for. If the cache does not contain the image, 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. It is synchronized via a mutex so that we can share a single Cache across each worker thread that the reconciler is running. The mutex is necessary due to the possibility of a panic if two workers were to attempt to read and write to the internal map at the same time.

func NewCache

func NewCache() *Cache

NewCache is a simple helper function that returns a pointer to a Cache that has had the internal cache map initialized.

Jump to

Keyboard shortcuts

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