diff --git a/pkg/blueprint/blueprint.go b/pkg/blueprint/blueprint.go index 1496d695ce..5d4cd50fb9 100644 --- a/pkg/blueprint/blueprint.go +++ b/pkg/blueprint/blueprint.go @@ -29,10 +29,12 @@ type Group struct { } type Container struct { - Source string `json:"source" toml:"source"` - Name string `json:"name,omitempty" toml:"name,omitempty"` + Source string `json:"source,omitempty" toml:"source"` + Name string `json:"name,omitempty" toml:"name,omitempty"` + Digest *string `json:"digest,omitempty" toml:"digest,omitempty"` - TLSVerify *bool `json:"tls-verify,omitempty" toml:"tls-verify,omitempty"` + TLSVerify *bool `json:"tls-verify,omitempty" toml:"tls-verify,omitempty"` + ContainersStorage *bool `json:"containers-storage,omitempty" toml:"containers-storage,omitempty"` } // packages, modules, and groups all resolve to rpm packages right now. This diff --git a/pkg/container/resolver.go b/pkg/container/resolver.go index 0a7648b011..75bdd278a5 100644 --- a/pkg/container/resolver.go +++ b/pkg/container/resolver.go @@ -23,9 +23,11 @@ type Resolver struct { } type SourceSpec struct { - Source string - Name string - TLSVerify *bool + Source string + Name string + Digest *string + TLSVerify *bool + ContainersStorage *bool } func NewResolver(arch string) Resolver { diff --git a/pkg/container/resolver_test.go b/pkg/container/resolver_test.go index 5ca468bfdc..1452ee19b0 100644 --- a/pkg/container/resolver_test.go +++ b/pkg/container/resolver_test.go @@ -35,7 +35,7 @@ func TestResolver(t *testing.T) { resolver := container.NewResolver("amd64") for _, r := range refs { - resolver.Add(container.SourceSpec{r, "", common.ToPtr(false)}) + resolver.Add(container.SourceSpec{r, "", common.ToPtr(""), common.ToPtr(false), nil}) } have, err := resolver.Finish() @@ -57,7 +57,7 @@ func TestResolver(t *testing.T) { func TestResolverFail(t *testing.T) { resolver := container.NewResolver("amd64") - resolver.Add(container.SourceSpec{"invalid-reference@${IMAGE_DIGEST}", "", common.ToPtr(false)}) + resolver.Add(container.SourceSpec{"invalid-reference@${IMAGE_DIGEST}", "", common.ToPtr(""), common.ToPtr(false), nil}) specs, err := resolver.Finish() assert.Error(t, err) @@ -66,7 +66,7 @@ func TestResolverFail(t *testing.T) { registry := NewTestRegistry() defer registry.Close() - resolver.Add(container.SourceSpec{registry.GetRef("repo"), "", common.ToPtr(false)}) + resolver.Add(container.SourceSpec{registry.GetRef("repo"), "", common.ToPtr(""), common.ToPtr(false), nil}) specs, err = resolver.Finish() assert.Error(t, err) assert.Len(t, specs, 0) diff --git a/pkg/container/spec.go b/pkg/container/spec.go index 15fe1572ae..2971ad4670 100644 --- a/pkg/container/spec.go +++ b/pkg/container/spec.go @@ -11,12 +11,13 @@ import ( // at the Source via Digest and ImageID. The latter one // should remain the same in the target image as well. type Spec struct { - Source string // does not include the manifest digest - Digest string // digest of the manifest at the Source - TLSVerify *bool // controls TLS verification - ImageID string // container image identifier - LocalName string // name to use inside the image - ListDigest string // digest of the list manifest at the Source (optional) + Source string // does not include the manifest digest + Digest string // digest of the manifest at the Source + TLSVerify *bool // controls TLS verification + ImageID string // container image identifier + LocalName string // name to use inside the image + ListDigest string // digest of the list manifest at the Source (optional) + ContainersStorage *bool // flag for a container in local containers-storage } // NewSpec creates a new Spec from the essential information.