Documentation ¶
Overview ¶
Secrets provides utility functions for handling secrets.
Index ¶
Constants ¶
View Source
const ( // VolumeMountRootDir is the directory on the container filesystem in // which SecretSource volumes are mounted. Each volume is mounted in a // subdirectory with the specified DirName. VolumeMountRootDir = "/vt/secrets" )
Variables ¶
This section is empty.
Functions ¶
func ContentHash ¶
ContentHash stably hashes secrets by their contents.
Types ¶
type VolumeMount ¶
type VolumeMount struct { // Secret is the SecretSource from which to load data. Secret *planetscalev2.SecretSource // DirName is the name of the directory under VolumeMountDir in which to // mount this SecretSource. DirName string // AbsolutePath stores the absolute path to use instead of the generated path // with /vt/secret as the prefix AbsolutePath string }
VolumeMount represents a mounted SecretSource.
func Mount ¶
func Mount(secretSource *planetscalev2.SecretSource, dirName string) *VolumeMount
Mount creates a VolumeMount for a given SecretSource.
func (*VolumeMount) ContainerVolumeMount ¶
func (v *VolumeMount) ContainerVolumeMount() corev1.VolumeMount
ContainerVolumeMount returns the VolumeMount that should be added to Containers that need this secret.
func (*VolumeMount) DirPath ¶
func (v *VolumeMount) DirPath() string
DirPath returns the absolute path to the mounted SecretSource volume.
func (*VolumeMount) FilePath ¶
func (v *VolumeMount) FilePath() string
FilePath returns the absolute path to the mounted file.
func (*VolumeMount) PodVolumes ¶
func (v *VolumeMount) PodVolumes() []corev1.Volume
PodVolumes returns the Volumes, if any, that should be added to Pods that need this secret.
func (*VolumeMount) VolumeName ¶
func (v *VolumeMount) VolumeName() string
VolumeName returns the name of the Pod Volume to be mounted.
Click to show internal directories.
Click to hide internal directories.