Skip to content

Commit

Permalink
revert #741: bind fuse connections into mount pod (#746)
Browse files Browse the repository at this point in the history
Signed-off-by: xixi <[email protected]>
  • Loading branch information
Hexilee authored Sep 11, 2023
1 parent 53e66bb commit ecddc72
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 49 deletions.
2 changes: 0 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ var (
JFSMountPriorityName = "system-node-critical"
JFSMountPreemptionPolicy = ""

FuseConnectionPath = "/sys/fs/fuse/connections"

TmpPodMountBase = "/tmp"
PodMountBase = "/jfs"
MountBase = "/var/lib/jfs"
Expand Down
51 changes: 16 additions & 35 deletions pkg/juicefs/mount/builder/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ import (
)

const (
JfsDirName = "jfs-dir"
FuseConnectinsName = "fuse-connections"
JfsRootDirName = "jfs-root-dir"
UpdateDBDirName = "updatedb"
UpdateDBCfgFile = "/etc/updatedb.conf"
JfsDirName = "jfs-dir"
JfsRootDirName = "jfs-root-dir"
UpdateDBDirName = "updatedb"
UpdateDBCfgFile = "/etc/updatedb.conf"
)

type Builder struct {
Expand Down Expand Up @@ -87,26 +86,15 @@ func (r *Builder) getVolumes() []corev1.Volume {
dir := corev1.HostPathDirectoryOrCreate
file := corev1.HostPathFileOrCreate
secretName := r.jfsSetting.SecretName
volumes := []corev1.Volume{
{
Name: JfsDirName,
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: config.MountPointPath,
Type: &dir,
},
},
},
{
Name: FuseConnectinsName,
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: config.FuseConnectionPath,
Type: &dir,
},
volumes := []corev1.Volume{{
Name: JfsDirName,
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: config.MountPointPath,
Type: &dir,
},
},
}
}}

if !config.Immutable {
volumes = append(volumes, corev1.Volume{
Expand Down Expand Up @@ -171,18 +159,11 @@ func (r *Builder) getVolumes() []corev1.Volume {

func (r *Builder) getVolumeMounts() []corev1.VolumeMount {
mp := corev1.MountPropagationBidirectional
volumeMounts := []corev1.VolumeMount{
{
Name: JfsDirName,
MountPath: config.PodMountBase,
MountPropagation: &mp,
},
{
Name: FuseConnectinsName,
MountPath: config.FuseConnectionPath,
MountPropagation: &mp,
},
}
volumeMounts := []corev1.VolumeMount{{
Name: JfsDirName,
MountPath: config.PodMountBase,
MountPropagation: &mp,
}}

if !config.Immutable {
volumeMounts = append(volumeMounts, corev1.VolumeMount{
Expand Down
12 changes: 0 additions & 12 deletions pkg/juicefs/mount/builder/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ var (
Type: &dir,
},
},
}, {
Name: FuseConnectinsName,
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: config.FuseConnectionPath,
Type: &dir,
},
},
}, {
Name: UpdateDBDirName,
VolumeSource: corev1.VolumeSource{
Expand Down Expand Up @@ -114,10 +106,6 @@ var (
MountPath: config.PodMountBase,
MountPropagation: &mp,
}, {
Name: FuseConnectinsName,
MountPath: config.FuseConnectionPath,
MountPropagation: &mp,
}, {

Name: UpdateDBDirName,
MountPath: UpdateDBCfgFile,
Expand Down

0 comments on commit ecddc72

Please sign in to comment.