platforms: add subarchless version of Only()#4943
Conversation
`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 <[email protected]>
3209ee4 to
e22ce0f
Compare
|
Build succeeded.
|
|
Fly-by comment; wondering; what's the behavior of |
If that were the case, we'd (currently) be getting I believe the implementation detail here is specifically in the (I'd point out that anywhere broken by the new fallbacks was probably already broken in the case of ARM variant matching just like the test I fixed, but it's less common and arguably less disruptive. 😬) I agree with the sentiment of this PR being a needed thing -- however, I've personally seen use cases for both strict and vector matching. Several platforms have adopted containerd's "platform string" syntax for a |
oh! I thought they were in reverse order, ignore my comment 👍 |
+1 on that; I recall having discussed a standardised format (and definition how they should be matched for missing (or optional) components in the past with @dmcgowan, @stevvooe and @tonistiigi |
|
Having the standardized syntax for limiting subarchs might be more preferable, but we might need several months for bikeshedding the new syntax. For v1.5, we need a quick solution to address the incompatibility introduced in #4528 . So I suggest merging this PR, and revisit the new syntax in v1.6+. |
SGTM |
|
Yeah, I agree with this -- no matter how that conversation ends up, we'll need an implementation to power it, which I believe this is. 😄 (I'd also just reiterate that #4528 didn't actually break compatibility - it was already broken - it just highlighted an existing edge case incompatibility by making it much more common 😇 ❤️) LGTM |
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".