Documentation ¶
Index ¶
Constants ¶
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 ¶
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 ¶
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 ¶
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.