Skip to content

Commit

Permalink
Merge pull request containers#1696 from nalind/compat-platform
Browse files Browse the repository at this point in the history
libimage: add compat interfaces for the new platform subpackage
  • Loading branch information
openshift-ci[bot] committed Oct 13, 2023
2 parents 06a73b1 + 14f1d70 commit 9f2f68b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions libimage/platform.go
@@ -0,0 +1,26 @@
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)
}

0 comments on commit 9f2f68b

Please sign in to comment.