Documentation ¶
Index ¶
- Constants
- func AddCopyStep(spec *v1alpha1.TaskSpec)
- func AddToEntrypointCache(c *Cache, sha string, ep []string)
- func GetArgs(stepNum int, commands, args []string) []string
- func GetRemoteEntrypoint(cache *Cache, digest string, kubeclient kubernetes.Interface, ...) ([]string, error)
- func RedirectStep(cache *Cache, stepNum int, step *corev1.Container, ...) error
- func RedirectSteps(cache *Cache, steps []corev1.Container, kubeclient kubernetes.Interface, ...) error
- type Cache
Constants ¶
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 ¶
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
AddToEntrypointCache adds an image digest and its entrypoint to the cache
func GetArgs ¶ added in v0.2.0
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.