@@ -22,33 +22,47 @@ import (
2222)
2323
2424// Platform is a type alias for convenience, so there is no need to import image-spec package everywhere.
25+ //
26+ // Deprecated: use [specs.Platform].
2527type Platform = specs.Platform
2628
2729// DefaultSpec returns the current platform's default platform specification.
30+ //
31+ // Deprecated: use [platforms.DefaultSpec].
2832func DefaultSpec () specs.Platform {
2933 return platforms .DefaultSpec ()
3034}
3135
3236// Default returns the default matcher for the platform.
37+ //
38+ // Deprecated: use [platforms.Default].
3339func Default () platforms.MatchComparer {
3440 return platforms .Default ()
3541}
3642
3743// DefaultString returns the default string specifier for the platform.
44+ //
45+ // Deprecated: use [platforms.DefaultString].
3846func DefaultString () string {
3947 return platforms .Format (platforms .DefaultSpec ()) // For 1.7 continue using the old format without os-version included.
4048}
4149
4250// DefaultStrict returns strict form of Default.
51+ //
52+ // Deprecated: use [platforms.DefaultStrict].
4353func DefaultStrict () MatchComparer {
4454 return platforms .DefaultStrict ()
4555}
4656
4757// MatchComparer is able to match and compare platforms to
4858// filter and sort platforms.
59+ //
60+ // Deprecated: use [platforms.MatchComparer].
4961type MatchComparer = platforms.MatchComparer
5062
5163// Matcher matches platforms specifications, provided by an image or runtime.
64+ //
65+ // Deprecated: use [platforms.Matcher].
5266type Matcher = platforms.Matcher
5367
5468// NewMatcher returns a simple matcher based on the provided platform
@@ -59,6 +73,8 @@ type Matcher = platforms.Matcher
5973// functionality.
6074//
6175// Applications should opt to use `Match` over directly parsing specifiers.
76+ //
77+ // Deprecated: use [platforms.NewMatcher].
6278func NewMatcher (platform specs.Platform ) platforms.Matcher {
6379 return platforms .NewMatcher (platform )
6480}
@@ -71,17 +87,23 @@ func NewMatcher(platform specs.Platform) platforms.Matcher {
7187// value will be matched against the known set of operating systems, then fall
7288// back to the known set of architectures. The missing component will be
7389// inferred based on the local environment.
90+ //
91+ // Deprecated: use [platforms.Parse].
7492func Parse (specifier string ) (specs.Platform , error ) {
7593 return platforms .Parse (specifier )
7694}
7795
7896// MustParse is like Parses but panics if the specifier cannot be parsed.
7997// Simplifies initialization of global variables.
98+ //
99+ // Deprecated: use [platforms.MustParse].
80100func MustParse (specifier string ) specs.Platform {
81101 return platforms .MustParse (specifier )
82102}
83103
84104// Format returns a string specifier from the provided platform specification.
105+ //
106+ // Deprecated: use [platforms.Format].
85107func Format (platform specs.Platform ) string {
86108 return platforms .Format (platform )
87109}
@@ -90,6 +112,8 @@ func Format(platform specs.Platform) string {
90112//
91113// For example, if "Aarch64" is encountered, we change it to "arm64" or if
92114// "x86_64" is encountered, it becomes "amd64".
115+ //
116+ // Deprecated: use [platforms.Normalize].
93117func Normalize (platform specs.Platform ) specs.Platform {
94118 return platforms .Normalize (platform )
95119}
@@ -101,6 +125,8 @@ func Normalize(platform specs.Platform) specs.Platform {
101125// For arm/v7, will also match arm/v6 and arm/v5
102126// For arm/v6, will also match arm/v5
103127// For amd64, will also match 386
128+ //
129+ // Deprecated: use [platforms.Only].
104130func Only (platform specs.Platform ) platforms.MatchComparer {
105131 return platforms .Only (platform )
106132}
@@ -113,26 +139,38 @@ func Only(platform specs.Platform) platforms.MatchComparer {
113139//
114140// OnlyStrict matches non-canonical forms.
115141// So, "arm64" matches "arm/64/v8".
142+ //
143+ // Deprecated: use [platforms.OnlyStrict].
116144func OnlyStrict (platform specs.Platform ) platforms.MatchComparer {
117145 return platforms .OnlyStrict (platform )
118146}
119147
120148// Ordered returns a platform MatchComparer which matches any of the platforms
121149// but orders them in order they are provided.
150+ //
151+ // Deprecated: use [platforms.Ordered].
122152func Ordered (platform ... specs.Platform ) platforms.MatchComparer {
123153 return platforms .Ordered (platform ... )
124154}
125155
126156// Any returns a platform MatchComparer which matches any of the platforms
127157// with no preference for ordering.
158+ //
159+ // Deprecated: use [platforms.Any].
128160func Any (platform ... specs.Platform ) platforms.MatchComparer {
129161 return platforms .Any (platform ... )
130162}
131163
132164// All is a platform MatchComparer which matches all platforms
133165// with preference for ordering.
166+ //
167+ // Deprecated: use [platforms.All].
134168var All = platforms .All
135169
170+ // GetWindowsOsVersion returns the version of Windows of the local system,
171+ // it returns an empty string on other platforms.
172+ //
173+ // Deprecated: this function is deprecated, and removed in github.com/containerd/platforms
136174func GetWindowsOsVersion () string {
137175 return getWindowsOsVersion ()
138176}
0 commit comments