File: platform.go

package info (click to toggle)
golang-github-containers-common 0.64.1%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,932 kB
  • sloc: makefile: 132; sh: 111
file content (28 lines) | stat: -rw-r--r-- 1,101 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//go:build !remote

package libimage

import (
	"github.com/containers/common/libimage/define"
	"github.com/containers/common/libimage/platform"
)

// PlatformPolicy controls the behavior of image-platform matching.
// Deprecated: new code should use define.PlatformPolicy directly.
type PlatformPolicy = define.PlatformPolicy

const (
	// Only debug log if an image does not match the expected platform.
	// Deprecated: new code should reference define.PlatformPolicyDefault directly.
	PlatformPolicyDefault = define.PlatformPolicyDefault
	// Warn if an image does not match the expected platform.
	// Deprecated: new code should reference define.PlatformPolicyWarn directly.
	PlatformPolicyWarn = define.PlatformPolicyWarn
)

// NormalizePlatform normalizes (according to the OCI spec) the specified os,
// arch and variant. If left empty, the individual item will be normalized.
// Deprecated: new code should call libimage/platform.Normalize() instead.
func NormalizePlatform(rawOS, rawArch, rawVariant string) (os, arch, variant string) {
	return platform.Normalize(rawOS, rawArch, rawVariant)
}