mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
vendor: bump c/common to v0.49.2-0.20220929111928-2d1b45ae2423
[NO NEW TESTS NEEDED] [NO TESTS NEEDED] Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
16
vendor/github.com/containers/common/libimage/platform.go
generated
vendored
16
vendor/github.com/containers/common/libimage/platform.go
generated
vendored
@@ -6,6 +6,7 @@ import (
|
||||
"runtime"
|
||||
|
||||
"github.com/containerd/containerd/platforms"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -20,9 +21,18 @@ const (
|
||||
)
|
||||
|
||||
// NormalizePlatform normalizes (according to the OCI spec) the specified os,
|
||||
// arch and variant. If left empty, the individual item will not be normalized.
|
||||
// arch and variant. If left empty, the individual item will be normalized.
|
||||
func NormalizePlatform(rawOS, rawArch, rawVariant string) (os, arch, variant string) {
|
||||
rawPlatform := toPlatformString(rawOS, rawArch, rawVariant)
|
||||
platformSpec := v1.Platform{
|
||||
OS: rawOS,
|
||||
Architecture: rawArch,
|
||||
Variant: rawVariant,
|
||||
}
|
||||
normalizedSpec := platforms.Normalize(platformSpec)
|
||||
if normalizedSpec.Variant == "" && rawVariant != "" {
|
||||
normalizedSpec.Variant = rawVariant
|
||||
}
|
||||
rawPlatform := toPlatformString(normalizedSpec.OS, normalizedSpec.Architecture, normalizedSpec.Variant)
|
||||
normalizedPlatform, err := platforms.Parse(rawPlatform)
|
||||
if err != nil {
|
||||
logrus.Debugf("Error normalizing platform: %v", err)
|
||||
@@ -38,7 +48,7 @@ func NormalizePlatform(rawOS, rawArch, rawVariant string) (os, arch, variant str
|
||||
arch = normalizedPlatform.Architecture
|
||||
}
|
||||
variant = rawVariant
|
||||
if rawVariant != "" {
|
||||
if rawVariant != "" || (rawVariant == "" && normalizedPlatform.Variant != "") {
|
||||
variant = normalizedPlatform.Variant
|
||||
}
|
||||
return os, arch, variant
|
||||
|
||||
6
vendor/github.com/containers/common/pkg/util/util_supported.go
generated
vendored
6
vendor/github.com/containers/common/pkg/util/util_supported.go
generated
vendored
@@ -11,6 +11,7 @@ import (
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/containers/storage/pkg/homedir"
|
||||
"github.com/containers/storage/pkg/unshare"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -31,7 +32,10 @@ func GetRuntimeDir() (string, error) {
|
||||
var rootlessRuntimeDirError error
|
||||
|
||||
rootlessRuntimeDirOnce.Do(func() {
|
||||
runtimeDir := os.Getenv("XDG_RUNTIME_DIR")
|
||||
runtimeDir, err := homedir.GetRuntimeDir()
|
||||
if err != nil {
|
||||
logrus.Debug(err)
|
||||
}
|
||||
if runtimeDir != "" {
|
||||
st, err := os.Stat(runtimeDir)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user