fix(cri): fix unexpected order of mounts since go 1.19

Signed-off-by: Bin Tang <bintang@BindeMacBook-Air.local>
This commit is contained in:
Bin Tang 2024-03-30 10:57:57 +08:00
parent c17839bdc7
commit 3830f81678
3 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ func WithDarwinMounts(osi osinterface.OS, config *runtime.ContainerConfig, extra
// Sort mounts in number of parts. This ensures that high level mounts don't
// shadow other mounts.
sort.Sort(orderedMounts(mounts))
sort.Stable(orderedMounts(mounts))
// Copy all mounts from default mounts, except for
// - mounts overridden by supplied mount;

View File

@ -65,7 +65,7 @@ func WithMounts(osi osinterface.OS, config *runtime.ContainerConfig, extra []*ru
// Sort mounts in number of parts. This ensures that high level mounts don't
// shadow other mounts.
sort.Sort(orderedMounts(mounts))
sort.Stable(orderedMounts(mounts))
// Mount cgroup into the container as readonly, which inherits docker's behavior.
s.Mounts = append(s.Mounts, runtimespec.Mount{

View File

@ -128,7 +128,7 @@ func WithWindowsMounts(osi osinterface.OS, config *runtime.ContainerConfig, extr
// Sort mounts in number of parts. This ensures that high level mounts don't
// shadow other mounts.
sort.Sort(orderedMounts(mounts))
sort.Stable(orderedMounts(mounts))
// Copy all mounts from default mounts, except for
// mounts overridden by supplied mount;