prow/pod-utils/decorate/podspec.go
func InjectEntrypoint(c *coreapi.Container, timeout, gracePeriod time.Duration, prefix, previousMarker string, exitZero bool, log, tools coreapi.VolumeMount) (*wrapper.Options, error) {
	wrapperOptions := &wrapper.Options{
		Args:         append(c.Command, c.Args...),
		ProcessLog:   processLog(log, prefix),
		MarkerFile:   markerFile(log, prefix),
		MetadataFile: metadataFile(log, prefix),
	}
	// TODO(fejta): use flags
	entrypointConfigEnv, err := entrypoint.Encode(entrypoint.Options{
		ArtifactDir:    artifactsDir(log),
		GracePeriod:    gracePeriod,
		Options:        wrapperOptions,
		Timeout:        timeout,
		AlwaysZero:     exitZero,
		PreviousMarker: previousMarker,
	})
	if err != nil {
		return nil, err
	}

	c.Command = []string{entrypointLocation(tools)}
	c.Args = nil
	c.Env = append(c.Env, kubeEnv(map[string]string{entrypoint.JSONConfigEnvVar: entrypointConfigEnv})...)
	c.VolumeMounts = append(c.VolumeMounts, log, tools)
	return wrapperOptions, nil
}
func InjectEntrypoint(c *coreapi.Container, timeout, gracePeriod time.Duration, prefix, previousMarker string, exitZero bool, log, tools coreapi.VolumeMount) (*wrapper.Options, error) {
	wrapperOptions := &wrapper.Options{
		Args:         append(c.Command, c.Args...),
		ProcessLog:   processLog(log, prefix),
		MarkerFile:   markerFile(log, prefix),
		MetadataFile: metadataFile(log, prefix),
	}
	// TODO(fejta): use flags
	entrypointConfigEnv, err := entrypoint.Encode(entrypoint.Options{
		ArtifactDir:    artifactsDir(log),
		GracePeriod:    gracePeriod,
		Options:        wrapperOptions,
		Timeout:        timeout,
		AlwaysZero:     exitZero,
		PreviousMarker: previousMarker,
	})
	if err != nil {
		return nil, err
	}

	c.Command = []string{entrypointLocation(tools)}
	c.Args = nil
	c.Env = append(c.Env, kubeEnv(map[string]string{entrypoint.JSONConfigEnvVar: entrypointConfigEnv})...)
	c.VolumeMounts = append(c.VolumeMounts, log, tools)
	return wrapperOptions, nil
}
func InjectEntrypoint ( c * coreapi . Container , timeout , gracePeriod time . Duration , prefix , previousMarker string , exitZero bool , log , tools coreapi . VolumeMount ) ( * wrapper . Options , error ) { wrapperOptions := & wrapper . Options { Args : append ( c . Command , c . Args ... ) , ProcessLog : processLog ( log , prefix ) , MarkerFile : markerFile ( log , prefix ) , MetadataFile : metadataFile ( log , prefix ) , } // TODO(fejta): use flags entrypointConfigEnv , err := entrypoint . Encode ( entrypoint . Options { ArtifactDir : artifactsDir ( log ) , GracePeriod : gracePeriod , Options : wrapperOptions , Timeout : timeout , AlwaysZero : exitZero , PreviousMarker : previousMarker , } ) if err != nil { return nil , err } c . Command = [ ] string { entrypointLocation ( tools ) } c . Args = nil c . Env = append ( c . Env , kubeEnv ( map [ string ] string { entrypoint . JSONConfigEnvVar : entrypointConfigEnv } ) ... ) c . VolumeMounts = append ( c . VolumeMounts , log , tools ) return wrapperOptions , nil }
// InjectEntrypoint will make the entrypoint binary in the tools volume the container's entrypoint, which will output to the log volume.
InjectEntrypoint will make the entrypoint binary in the tools volume the container s entrypoint which will output to the log volume .