Get and set architectures.
This fixes a bug we ran into today as a part of multi-arch migrations.
First, describing the bug:
When building an image, OSBS looks at the architectures set in koji on the
'build' tag associated with the koji target of the requested build. This is
fine, normally. When a set of builds is ready to "go multi-arch", we just
start adding architectures to their build tag and suddenly, new builds produce
multiarch images.
When freshmaker comes along, it tries to rebuild based on the last shipped
image and reuses the parent image and the koji target of the last shipped
image. Now, the last shipped image's parent is single-arch (from a few months
ago), but the koji target now has a koji tag that specifies multiple
architectures. OSBS fails our build because it cannot build a multiarch build
on a single arch parent.
The fix here is to look up the architectures produced by the last-shipped build
and simply copy those into our request for the new build (just like we do with
the scm url and koji target). The architectures of the last-shipped build are
pulled from the manifest list api in the registry associated with koji.
There is a corresponding change in OSBS that allows Freshmaker to supply the
list of architectures which should be used for the new build here:
https://github.com/release-engineering/koji-containerbuild/pull/99
We're going from 1 to N architectures now, but in the future we'll make moves
again to go from N to N+1 architectures which warrants the complexity
introduced in this change.