prow/pod-utils/decorate/podspec.go
func cookiefileVolume(secret string) (coreapi.Volume, coreapi.VolumeMount, string) {
	// Separate secret-name/key-in-secret
	parts := strings.SplitN(secret, "/", 2)
	cookieSecret := parts[0]
	var base string
	if len(parts) == 1 {
		base = parts[0] // Assume key-in-secret == secret-name
	} else {
		base = parts[1]
	}
	var cookiefileMode int32 = 0400 // u+r
	vol := coreapi.Volume{
		Name: "cookiefile",
		VolumeSource: coreapi.VolumeSource{
			Secret: &coreapi.SecretVolumeSource{
				SecretName:  cookieSecret,
				DefaultMode: &cookiefileMode,
			},
		},
	}
	mount := coreapi.VolumeMount{
		Name:      vol.Name,
		MountPath: "/secrets/cookiefile", // append base to flag
		ReadOnly:  true,
	}
	return vol, mount, path.Join(mount.MountPath, base)
}
func cookiefileVolume(secret string) (coreapi.Volume, coreapi.VolumeMount, string) {
	// Separate secret-name/key-in-secret
	parts := strings.SplitN(secret, "/", 2)
	cookieSecret := parts[0]
	var base string
	if len(parts) == 1 {
		base = parts[0] // Assume key-in-secret == secret-name
	} else {
		base = parts[1]
	}
	var cookiefileMode int32 = 0400 // u+r
	vol := coreapi.Volume{
		Name: "cookiefile",
		VolumeSource: coreapi.VolumeSource{
			Secret: &coreapi.SecretVolumeSource{
				SecretName:  cookieSecret,
				DefaultMode: &cookiefileMode,
			},
		},
	}
	mount := coreapi.VolumeMount{
		Name:      vol.Name,
		MountPath: "/secrets/cookiefile", // append base to flag
		ReadOnly:  true,
	}
	return vol, mount, path.Join(mount.MountPath, base)
}
func cookiefileVolume ( secret string ) ( coreapi . Volume , coreapi . VolumeMount , string ) { // Separate secret-name/key-in-secret parts := strings . SplitN ( secret , " " , 2 ) cookieSecret := parts [ 0 ] var base string if len ( parts ) == 1 { base = parts [ 0 ] // Assume key-in-secret == secret-name } else { base = parts [ 1 ] } var cookiefileMode int32 = 0400 // u+r vol := coreapi . Volume { Name : " " , VolumeSource : coreapi . VolumeSource { Secret : & coreapi . SecretVolumeSource { SecretName : cookieSecret , DefaultMode : & cookiefileMode , } , } , } mount := coreapi . VolumeMount { Name : vol . Name , MountPath : " " , // append base to flag ReadOnly : true , } return vol , mount , path . Join ( mount . MountPath , base ) }
// cookiefileVolumes converts a secret holding cookies into the corresponding volume and mount.
//
// Secret can be of the form secret-name/base-name or just secret-name.
// Here secret-name refers to the kubernetes secret volume to mount, and base-name refers to the key in the secret
// where the cookies are stored. The secret-name pattern is equivalent to secret-name/secret-name.
//
// This is used by CloneRefs to attach the mount to the clonerefs container.
// The returned string value is the path to the cookiefile for use with --cookiefile.
cookiefileVolumes converts a secret holding cookies into the corresponding volume and mount . Secret can be of the form secret - name / base - name or just secret - name . Here secret - name refers to the kubernetes secret volume to mount and base - name refers to the key in the secret where the cookies are stored . The secret - name pattern is equivalent to secret - name / secret - name . This is used by CloneRefs to attach the mount to the clonerefs container . The returned string value is the path to the cookiefile for use with -- cookiefile .