1 package configAutomount 2 3 type MountAs int 4 type VolumeType int 5 6 const ( 7 MountAsFile MountAs = iota + 1 8 MountAsSubpath 9 MountAsEnv 10 ) 11 12 const ( 13 VolumeTypePVC VolumeType = iota + 1 14 VolumeTypeConfigmap 15 VolumeTypeSecret 16 ) 17 18 type AutomountInfo struct { 19 // VolumeType gives the type of the volume (PVC, Secret, ConfigMap) 20 VolumeType VolumeType 21 // VolumeName is the name of the resource to mount 22 VolumeName string 23 // MountPath indicates on which path to mount the volume (empty if MountAs is Env) 24 MountPath string 25 // MountAs indicates how to mount the volume 26 // - File: by default 27 // - Env: As environment variables (for Secret and Configmap) 28 // - Subpath: As individual files in specific paths (For Secret and ConfigMap). Keys must be provided 29 MountAs MountAs 30 // ReadOnly indicates to mount the volume as Read-Only 31 ReadOnly bool 32 // Keys defines the list of keys to mount when MountAs is Subpath 33 Keys []string 34 // MountAccessMode indicates the access mode for configmap and secret mounted as files 35 MountAccessMode *int32 36 } 37 38 type Client interface { 39 GetAutomountingVolumes() ([]AutomountInfo, error) 40 } 41