Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libimage: add compat interfaces for the new platform subpackage #1696

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions libimage/platform.go
Original file line number Diff line number Diff line change
@@ -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)
}