forked from containers/common
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request containers#1696 from nalind/compat-platform
libimage: add compat interfaces for the new platform subpackage
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |