Skip to content

Commit

Permalink
fix: cache path mont propagation (#1021)
Browse files Browse the repository at this point in the history
* fix: cache path mont propagation

* fix: cache path mont propagation
  • Loading branch information
luoyuedong authored Feb 22, 2023
1 parent 6c56c57 commit 05a26ef
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/fs/csiplugin/mount/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,25 +306,26 @@ func buildMountContainer(mountContainer k8sCore.Container, mountInfo Info) k8sCo
},
}

mp := k8sCore.MountPropagationBidirectional
m1 := k8sCore.MountPropagationBidirectional
m2 := k8sCore.MountPropagationNone
volumeMounts := []k8sCore.VolumeMount{
{
Name: VolumesKeyMount,
MountPath: schema.FusePodMntDir,
SubPath: mountInfo.FS.ID,
MountPropagation: &mp,
MountPropagation: &m1,
},
}
if mountInfo.CacheConfig.CacheDir != "" {
dataCacheVM := k8sCore.VolumeMount{
Name: VolumesKeyDataCache,
MountPath: FusePodCachePath + DataCacheDir,
MountPropagation: &mp,
MountPropagation: &m2,
}
metaCacheVM := k8sCore.VolumeMount{
Name: VolumesKeyMetaCache,
MountPath: FusePodCachePath + MetaCacheDir,
MountPropagation: &mp,
MountPropagation: &m2,
}
volumeMounts = append(volumeMounts, dataCacheVM, metaCacheVM)
}
Expand Down Expand Up @@ -375,7 +376,7 @@ func buildCacheWorkerContainer(cacheContainer k8sCore.Container, mountInfo Info)
cacheContainer.Name = ContainerNameCacheWorker
cacheContainer.Command = []string{"sh", "-c", mountInfo.CacheWorkerCmd()}
if mountInfo.CacheConfig.CacheDir != "" {
mp := k8sCore.MountPropagationBidirectional
mp := k8sCore.MountPropagationNone
volumeMounts := []k8sCore.VolumeMount{
{
Name: VolumesKeyDataCache,
Expand Down

0 comments on commit 05a26ef

Please sign in to comment.