mirror of
https://github.com/containers/podman.git
synced 2025-09-28 01:04:28 +08:00
Handle podman-remote --arch, --platform, --os
Podman remote should be able to handle remote specification of arches. Requires: https://github.com/containers/buildah/pull/3116 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:

committed by
Ed Santiago

parent
68269a0ee1
commit
b68106703e
25
vendor/github.com/containers/buildah/util/util.go
generated
vendored
25
vendor/github.com/containers/buildah/util/util.go
generated
vendored
@ -6,6 +6,8 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
@ -474,3 +476,26 @@ func MergeEnv(defaults, overrides []string) []string {
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
type byDestination []specs.Mount
|
||||
|
||||
func (m byDestination) Len() int {
|
||||
return len(m)
|
||||
}
|
||||
|
||||
func (m byDestination) Less(i, j int) bool {
|
||||
return m.parts(i) < m.parts(j)
|
||||
}
|
||||
|
||||
func (m byDestination) Swap(i, j int) {
|
||||
m[i], m[j] = m[j], m[i]
|
||||
}
|
||||
|
||||
func (m byDestination) parts(i int) int {
|
||||
return strings.Count(filepath.Clean(m[i].Destination), string(os.PathSeparator))
|
||||
}
|
||||
|
||||
func SortMounts(m []specs.Mount) []specs.Mount {
|
||||
sort.Sort(byDestination(m))
|
||||
return m
|
||||
}
|
||||
|
Reference in New Issue
Block a user