entrypoint

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 14 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             = "/builder/tools"
	DownwardMountName      = "downward"
	DownwardMountPoint     = "/builder/downward"
	DownwardMountReadyFile = "ready"
	BinaryLocation         = MountPoint + "/entrypoint"
	JSONConfigEnvVar       = "ENTRYPOINT_OPTIONS"
	InitContainerName      = "place-tools"
)

Variables

This section is empty.

Functions

func AddCopyStep

func AddCopyStep(spec *v1alpha1.TaskSpec)

AddCopyStep will prepend a Step (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 AddToEntrypointCache added in v0.2.0

func AddToEntrypointCache(c *Cache, sha string, ep []string)

AddToEntrypointCache adds an image digest and its entrypoint to the cache

func GetArgs added in v0.2.0

func GetArgs(stepNum int, commands, args []string) []string

GetArgs returns the arguments that should be specified for the step which has been wrapped such that it will execute our custom entrypoint instead of the user provided Command and Args.

func GetRemoteEntrypoint

func GetRemoteEntrypoint(cache *Cache, digest string, kubeclient kubernetes.Interface, taskRun *v1alpha1.TaskRun) ([]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 RedirectStep added in v0.3.0

func RedirectStep(cache *Cache, stepNum int, step *corev1.Container, kubeclient kubernetes.Interface, taskRun *v1alpha1.TaskRun, logger *zap.SugaredLogger) error

RedirectStep will modify a step/container 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.

func RedirectSteps

func RedirectSteps(cache *Cache, steps []corev1.Container, kubeclient kubernetes.Interface, taskRun *v1alpha1.TaskRun, logger *zap.SugaredLogger) 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