cloudapi: support container embedding

Add support for embedding container images via the cloud API. For
this the container resolve job was plumbed into the cloud api's
handler and the API specification updated with a new `containers`
section that mimics the blueprint section with the same name.
This commit is contained in:
Christian Kellner 2022-07-27 15:52:24 +02:00 committed by Tomáš Hozza
parent 45850639a0
commit 388154d7f6
7 changed files with 341 additions and 119 deletions

View file

@ -173,6 +173,19 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
}
}
if request.Customizations != nil && request.Customizations.Containers != nil {
for _, c := range *request.Customizations.Containers {
bc := blueprint.Container{
Source: c.Source,
TLSVerify: c.TlsVerify,
}
if c.Name != nil {
bc.Name = *c.Name
}
bp.Containers = append(bp.Containers, bc)
}
}
if request.Customizations != nil && request.Customizations.Filesystem != nil {
var fsCustomizations []blueprint.FilesystemCustomization
for _, f := range *request.Customizations.Filesystem {