From fbd6d804f08be42ec20fcfcc8f25b6dd6561184c Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Thu, 30 Jun 2022 11:03:51 +0200 Subject: [PATCH] blueprint: add support for containers Add a new `containers` section that can be used to request the embedding of containers into images. The only requirement is the source property to specify where to fetch the container from. This suppports specifying the digest of the container or the tag. In case none is given it defaults to the `latest` tag. The `Name` field can be used to optionally specify a name to use inside the image. NB: currently no tools or apis support container resolution yet. This follows in the next commits. --- cmd/gen-manifests/main.go | 1 + internal/blueprint/blueprint.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/cmd/gen-manifests/main.go b/cmd/gen-manifests/main.go index 6a97b477d..502a959dc 100644 --- a/cmd/gen-manifests/main.go +++ b/cmd/gen-manifests/main.go @@ -49,6 +49,7 @@ type crBlueprint struct { Packages []blueprint.Package `json:"packages,omitempty"` Modules []blueprint.Package `json:"modules,omitempty"` Groups []blueprint.Group `json:"groups,omitempty"` + Containers []blueprint.Container `json:"containers,omitempty"` Customizations *blueprint.Customizations `json:"customizations,omitempty"` Distro string `json:"distro,omitempty"` } diff --git a/internal/blueprint/blueprint.go b/internal/blueprint/blueprint.go index f90154b09..546b3ff6a 100644 --- a/internal/blueprint/blueprint.go +++ b/internal/blueprint/blueprint.go @@ -18,6 +18,7 @@ type Blueprint struct { Packages []Package `json:"packages" toml:"packages"` Modules []Package `json:"modules" toml:"modules"` Groups []Group `json:"groups" toml:"groups"` + Containers []Container `json:"containers,omitempty" toml:"containers,omitempty"` Customizations *Customizations `json:"customizations,omitempty" toml:"customizations,omitempty"` Distro string `json:"distro" toml:"distro"` } @@ -41,6 +42,13 @@ type Group struct { Name string `json:"name" toml:"name"` } +type Container struct { + Source string `json:"source" toml:"source"` + Name string `json:"name,omitempty" toml:"name,omitempty"` + + TLSVerify *bool `json:"tls-verify,omitempty" toml:"tls-verify,omitempty"` +} + // DeepCopy returns a deep copy of the blueprint // This uses json.Marshal and Unmarshal which are not very efficient func (b *Blueprint) DeepCopy() Blueprint {