platforms: add subarchless version of Only()
`OnlyStrict()` returns a match comparer for a single platform. Unlike `Only()`, `OnlyStrict()` does not match sub platforms. So, "arm/vN" will not match "arm/vM" where M < N, and "amd64" will not also match "386". `OnlyStrict()` matches non-canonical forms. So, "arm64" matches "arm/64/v8". Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
@@ -36,3 +36,8 @@ func DefaultSpec() specs.Platform {
|
||||
Variant: cpuVariant,
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultStrict returns strict form of Default.
|
||||
func DefaultStrict() MatchComparer {
|
||||
return OnlyStrict(DefaultSpec())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user