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, image string, kubeclient kubernetes.Interface, ...) ([]string, error)
- func RedirectStep(cache *Cache, stepNum int, step *v1alpha1.Step, ...) error
- func RedirectSteps(cache *Cache, steps []v1alpha1.Step, 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 ¶
AddToEntrypointCache adds an image digest and its entrypoint to the cache
func GetArgs ¶
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, image 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 ¶
func RedirectStep(cache *Cache, stepNum int, step *v1alpha1.Step, 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 []v1alpha1.Step, 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.