store: drop support for multi-image composes

The store only serves the weldr API, and that hard-codes the assumption
of only one image build per compose all over the place. Move this
assumption into the json serialization handler.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-05-12 02:27:46 +02:00
parent e28fca493c
commit fba2af5f51
7 changed files with 141 additions and 168 deletions

View file

@ -78,8 +78,8 @@ func (ib *ImageBuild) GetLocalTargetOptions() *target.LocalTargetOptions {
// It contains all the information necessary to generate the inputs for the job, as
// well as the job's state.
type Compose struct {
Blueprint *blueprint.Blueprint
ImageBuilds []ImageBuild
Blueprint *blueprint.Blueprint
ImageBuild ImageBuild
}
// DeepCopy creates a copy of the Compose structure
@ -89,12 +89,8 @@ func (c *Compose) DeepCopy() Compose {
bpCopy := *c.Blueprint
newBpPtr = &bpCopy
}
newImageBuilds := []ImageBuild{}
for _, ib := range c.ImageBuilds {
newImageBuilds = append(newImageBuilds, ib.DeepCopy())
}
return Compose{
Blueprint: newBpPtr,
ImageBuilds: newImageBuilds,
Blueprint: newBpPtr,
ImageBuild: c.ImageBuild.DeepCopy(),
}
}