Documentation
¶
Index ¶
- Constants
- func GenJobNameByVolumeId(volumeId string) string
- func GetRef(pod *corev1.Pod) int
- func NewFuseAbortJob(mountpod *corev1.Pod, devMinor uint32) *batchv1.Job
- func SetJobAsOwner(secret *corev1.Secret, owner batchv1.Job)
- func SetPVAsOwner(secret *corev1.Secret, owner *corev1.PersistentVolume)
- func SetPVCAsOwner(secret *corev1.Secret, owner *corev1.PersistentVolumeClaim)
- func SetPodAsOwner(secret *corev1.Secret, owner corev1.Pod)
- type BaseBuilder
- type JobBuilder
- type MntInterface
- type PodBuilder
- type PodMount
- func (p *PodMount) AddRefOfMount(ctx context.Context, target string, podName string) error
- func (p *PodMount) CleanCache(ctx context.Context, image string, id string, volumeId string, ...) error
- func (p *PodMount) DMount(ctx context.Context, appInfo *config.AppInfo, dfsSetting *config.DfsSetting) error
- func (p *PodMount) DUmount(ctx context.Context, target, podName string) error
- func (p *PodMount) DeleteVolume(ctx context.Context, dfsSetting *config.DfsSetting) error
- func (p *PodMount) GetMountRef(ctx context.Context, target, podName string) (int, error)
- func (p *PodMount) JUmount(ctx context.Context, target, podName string) error
- func (p *PodMount) UmountTarget(ctx context.Context, target, podName string) error
Constants ¶
View Source
const ( DfsDirName = "dfs-dir" HostDirName = "host-dir" UpdateDBDirName = "updatedb" UpdateDBCfgFile = "/etc/updatedb.conf" DfsFuseFdPathName = "dfs-fuse-fd" DfsFuseFsPathInPod = "/tmp" DfsFuseFsPathInHost = "/var/run/dingofs-csi" DfsCommEnv = "Dfs_SUPER_COMM" )
View Source
const DefaultJobTTLSecond = int32(5)
Variables ¶
This section is empty.
Functions ¶
func GenJobNameByVolumeId ¶
func SetPVAsOwner ¶
func SetPVAsOwner(secret *corev1.Secret, owner *corev1.PersistentVolume)
func SetPVCAsOwner ¶
func SetPVCAsOwner(secret *corev1.Secret, owner *corev1.PersistentVolumeClaim)
Types ¶
type BaseBuilder ¶
type BaseBuilder struct {
// contains filtered or unexported fields
}
func (*BaseBuilder) NewSecret ¶
func (r *BaseBuilder) NewSecret() corev1.Secret
type JobBuilder ¶
type JobBuilder struct {
PodBuilder
}
func NewJobBuilder ¶
func NewJobBuilder(setting *config.DfsSetting, capacity int64) *JobBuilder
func (*JobBuilder) NewJobForCleanCache ¶
func (r *JobBuilder) NewJobForCleanCache() *batchv1.Job
func (*JobBuilder) NewJobForCreateVolume ¶
func (r *JobBuilder) NewJobForCreateVolume() *batchv1.Job
func (*JobBuilder) NewJobForDeleteVolume ¶
func (r *JobBuilder) NewJobForDeleteVolume() *batchv1.Job
type MntInterface ¶
type MntInterface interface {
k8sMount.Interface
DMount(ctx context.Context, appInfo *config.AppInfo, dfsSetting *config.DfsSetting) error
// DCreateVolume(ctx context.Context, dfsSetting *dfsConfig.dfsSetting) error
DeleteVolume(ctx context.Context, dfsSetting *config.DfsSetting) error
GetMountRef(ctx context.Context, target, podName string) (int, error)
UmountTarget(ctx context.Context, target, podName string) error
DUmount(ctx context.Context, target, podName string) error
AddRefOfMount(ctx context.Context, target string, podName string) error
CleanCache(ctx context.Context, image string, id string, volumeId string, cacheDirs []string) error
}
func NewPodMount ¶
func NewPodMount(client *k8sclient.K8sClient, mounter k8sMount.SafeFormatAndMount) MntInterface
type PodBuilder ¶
type PodBuilder struct {
BaseBuilder
K8sClient *k8sclient.K8sClient
}
func NewPodBuilder ¶
func NewPodBuilder(setting *config.DfsSetting, capacity int64, k8sCli *k8sclient.K8sClient) *PodBuilder
func (*PodBuilder) NewMountPod ¶
func (r *PodBuilder) NewMountPod(podName string) (*corev1.Pod, error)
NewMountPod generates a pod with dingo-fuse bootstrap
type PodMount ¶
type PodMount struct {
k8sMount.SafeFormatAndMount
K8sClient *k8sclient.K8sClient
}
func (*PodMount) AddRefOfMount ¶
func (*PodMount) CleanCache ¶
func (*PodMount) DMount ¶
func (p *PodMount) DMount(ctx context.Context, appInfo *config.AppInfo, dfsSetting *config.DfsSetting) error
DMount mount dfs volume
func (*PodMount) DeleteVolume ¶
func (*PodMount) GetMountRef ¶
Click to show internal directories.
Click to hide internal directories.