Merge pull request #10021 from sctb512/fix-unstable-sort

fix(cri): fix unexpected order of mounts since go 1.19
This commit is contained in:
Maksym Pavlenko 2024-04-02 21:26:09 +00:00 committed by GitHub
commit 0807efb9ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;