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 8, 2024
1 parent e377cd5 commit 9701cf9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cri/opts/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,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.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,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 9701cf9

Please sign in to comment.