builder

package
v0.0.0-...-6565e32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

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 GenJobNameByVolumeId(volumeId string) string

func GetRef

func GetRef(pod *corev1.Pod) int

func NewFuseAbortJob

func NewFuseAbortJob(mountpod *corev1.Pod, devMinor uint32) *batchv1.Job

func SetJobAsOwner

func SetJobAsOwner(secret *corev1.Secret, owner batchv1.Job)

func SetPVAsOwner

func SetPVAsOwner(secret *corev1.Secret, owner *corev1.PersistentVolume)

func SetPVCAsOwner

func SetPVCAsOwner(secret *corev1.Secret, owner *corev1.PersistentVolumeClaim)

func SetPodAsOwner

func SetPodAsOwner(secret *corev1.Secret, owner corev1.Pod)

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 (p *PodMount) AddRefOfMount(ctx context.Context, target string, podName string) error

func (*PodMount) CleanCache

func (p *PodMount) CleanCache(ctx context.Context, image string, id string, volumeId string, cacheDirs []string) error

func (*PodMount) DMount

func (p *PodMount) DMount(ctx context.Context, appInfo *config.AppInfo, dfsSetting *config.DfsSetting) error

DMount mount dfs volume

func (*PodMount) DUmount

func (p *PodMount) DUmount(ctx context.Context, target, podName string) error

func (*PodMount) DeleteVolume

func (p *PodMount) DeleteVolume(ctx context.Context, dfsSetting *config.DfsSetting) error

func (*PodMount) GetMountRef

func (p *PodMount) GetMountRef(ctx context.Context, target, podName string) (int, error)

func (*PodMount) JUmount

func (p *PodMount) JUmount(ctx context.Context, target, podName string) error

func (*PodMount) UmountTarget

func (p *PodMount) UmountTarget(ctx context.Context, target, podName string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL