distro: add ListArchs() to Distro interface

Similar to ListImageTypes() add a helper to enumerate the supported
architectures.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-03-24 13:46:19 +01:00 committed by msehnout
parent 4a7519807e
commit f903601ec4
8 changed files with 57 additions and 0 deletions

View file

@ -16,6 +16,10 @@ type testImageType struct{}
const name = "test-distro"
const modulePlatformID = "platform:test"
func (d *TestDistro) ListArchs() []string {
return []string{"test_arch"}
}
func (d *TestDistro) GetArch(arch string) (distro.Arch, error) {
if arch != "test_arch" {
return nil, errors.New("invalid arch: " + arch)