Commit Graph

56 Commits

Author SHA1 Message Date
Wei Chen
4355ba2f83 ctr: Add helpers to database to check Linux and ARM arch
On ARM platforms, we have to prepare the variant for spec.platform.
Currently, this action would only work on Linux/ARM system. We
introduce these two helpers to check running system's OS and Arch.

Change-Id: Iff14087699219413779dd6caf1bf9524db1cc19e
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
2017-12-20 14:49:45 +08:00
Daniel Nephin
fe5bb4a0fc Update platform tests to use the defaultOS
fix tests on windows

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-15 14:31:50 -05:00
Stephen J Day
9163377123
platforms: provide simpler function for common use
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-20 11:56:59 -07:00
Stephen J Day
775f7cea47
platforms: update format for platform specifier
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-13 11:41:45 -07:00
Stephen J Day
94f6be5f10
platforms: implement matcher support
Matching support is now implemented in the platforms package. The
`Parse` function now returns a matcher object that can be used to
match OCI platform specifications. We define this as an interface to
allow the creation of helpers oriented around platform selection.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-08 19:22:29 -07:00
Stephen J Day
fb0688362c
platforms: define selectors for platforms
For supporting selection of images and runtimes in the containerized
world, there is thin support for selecting objects by platform. This
package defines a syntax to display to users that can express specific
platforms in addition to wild cards for matching platforms.

The plan is to extend this to provide support for parsing flag
arguments and displaying platform types for images. This package will
also provide a configurable matcher to allow match of platforms against
arbitrary targets, invariant to the Go compilation.

The internals are based the OCI Image Spec model.

This changeset is being submitted for feedback on the approach before
this gets larger. Specifically, review the unit tests and raise any
concerns.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-08 15:05:21 -07:00