type AutomountInfo struct {
// VolumeType gives the type of the volume (PVC, Secret, ConfigMap)
VolumeType VolumeType
// VolumeName is the name of the resource to mount
VolumeName string
// MountPath indicates on which path to mount the volume (empty if MountAs is Env)
MountPath string
// MountAs indicates how to mount the volume
// - File: by default
// - Env: As environment variables (for Secret and Configmap)
// - Subpath: As individual files in specific paths (For Secret and ConfigMap). Keys must be provided
MountAs MountAs
// ReadOnly indicates to mount the volume as Read-Only
ReadOnly bool
// Keys defines the list of keys to mount when MountAs is Subpath
Keys []string
// MountAccessMode indicates the access mode for configmap and secret mounted as files
MountAccessMode *int32
}
type Client interface {
GetAutomountingVolumes() ([]AutomountInfo, error)
}
type KubernetesClient struct {
// contains filtered or unexported fields
}
func NewKubernetesClient(kubeClient kclient.ClientInterface) KubernetesClient
func (o KubernetesClient) GetAutomountingVolumes() ([]AutomountInfo, error)
MockClient is a mock of Client interface.
type MockClient struct {
// contains filtered or unexported fields
}
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockClient) GetAutomountingVolumes() ([]AutomountInfo, error)
GetAutomountingVolumes mocks base method.
MockClientMockRecorder is the mock recorder for MockClient.
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
func (mr *MockClientMockRecorder) GetAutomountingVolumes() *gomock.Call
GetAutomountingVolumes indicates an expected call of GetAutomountingVolumes.
type MountAs int
const (
MountAsFile MountAs = iota + 1
MountAsSubpath
MountAsEnv
)
type VolumeType int
const (
VolumeTypePVC VolumeType = iota + 1
VolumeTypeConfigmap
VolumeTypeSecret
)