Documentation
¶
Index ¶
- Constants
- Variables
- func GeneratePodNameByVolumeId(volumeId string) string
- func NewMountPod(podName, cmd, mountPath string, ...) *corev1.Pod
- type ConfigSecretVolume
- type FakeK8sClient
- func (f *FakeK8sClient) CreatePod(pod *corev1.Pod) (*corev1.Pod, error)
- func (f *FakeK8sClient) DeletePod(pod *corev1.Pod) error
- func (f *FakeK8sClient) Flush()
- func (f *FakeK8sClient) GetPod(podName, namespace string) (*corev1.Pod, error)
- func (f *FakeK8sClient) PatchPod(pod *corev1.Pod, data []byte) error
- func (f *FakeK8sClient) UpdatePod(pod *corev1.Pod) error
- type Interface
- type Jfs
- type JfsSetting
- type K8sClient
Constants ¶
View Source
const ( PodTypeKey = "app.kubernetes.io/name" PodTypeValue = "juicefs-mount" Finalizer = "juicefs.com/finalizer" )
Variables ¶
View Source
var ( NodeName = "" Namespace = "" PodName = "" MountImage = "" MountPointPath = "/var/lib/juicefs/volume" JFSConfigPath = "/var/lib/juicefs/config" JFSMountPriorityName = "" )
View Source
var FakeClient = &FakeK8sClient{ PodMap: make(map[string]*corev1.Pod), lock: sync.RWMutex{}, }
View Source
var JLock = sync.RWMutex{}
Functions ¶
func GeneratePodNameByVolumeId ¶ added in v0.10.0
func NewMountPod ¶ added in v0.10.0
Types ¶
type ConfigSecretVolume ¶ added in v0.10.0
type FakeK8sClient ¶ added in v0.10.3
type FakeK8sClient struct { PodMap map[string]*corev1.Pod // contains filtered or unexported fields }
FakeK8sClient creates a new mock k8s client used for testing
func (*FakeK8sClient) DeletePod ¶ added in v0.10.3
func (f *FakeK8sClient) DeletePod(pod *corev1.Pod) error
func (*FakeK8sClient) Flush ¶ added in v0.10.3
func (f *FakeK8sClient) Flush()
func (*FakeK8sClient) GetPod ¶ added in v0.10.3
func (f *FakeK8sClient) GetPod(podName, namespace string) (*corev1.Pod, error)
type Interface ¶
type Interface interface { mount.Interface JfsMount(volumeID string, target string, secrets, volCtx map[string]string, options []string) (Jfs, error) JfsUnmount(mountPath string) error DelRefOfMountPod(volumeId, target string) error AuthFs(secrets map[string]string) ([]byte, error) MountFs(volumeID string, target string, options []string, jfsSetting *JfsSetting) (string, error) Version() ([]byte, error) }
Interface of juicefs provider
func NewJfsProvider ¶
func NewJfsProvider(mounter *mount.SafeFormatAndMount) (Interface, error)
NewJfsProvider creates a provider for JuiceFS file system
type Jfs ¶
type Jfs interface { GetBasePath() string CreateVol(volumeID, subPath string) (string, error) DeleteVol(volumeID string, secrets map[string]string) error }
Jfs is the interface of a mounted file system
type JfsSetting ¶ added in v0.10.0
type JfsSetting struct { IsCe bool Name string `json:"name"` MetaUrl string `json:"metaurl"` Source string `json:"source"` Configs map[string]string `json:"configs"` Envs map[string]string `json:"envs"` MountPodCpuLimit string `json:"mount_pod_cpu_limit"` MountPodMemLimit string `json:"mount_pod_mem_limit"` MountPodCpuRequest string `json:"mount_pod_cpu_request"` MountPodMemRequest string `json:"mount_pod_mem_request"` }
func ParseSetting ¶ added in v0.10.0
func ParseSetting(secrets, volCtx map[string]string) (*JfsSetting, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.