Skip to content

Commit

Permalink
fix(cri): fix unexpected order of mounts since go 1.19
Browse files Browse the repository at this point in the history
Signed-off-by: Bin Tang <tangbin.bin@bytedance.com>
  • Loading branch information
sctb512 committed Apr 11, 2024
1 parent 088acb0 commit 9f774e4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/cri/opts/spec_darwin_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/opts/spec_linux_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/opts/spec_windows_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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;
Expand Down

0 comments on commit 9f774e4

Please sign in to comment.