diff --git a/go.mod b/go.mod index d37cb686..de849891 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/containerd/containerd v1.6.6 github.com/docker/cli v20.10.0-rc1+incompatible github.com/drone/envsubst v1.0.2 - github.com/gardener/component-spec/bindings-go v0.0.90 + github.com/gardener/component-spec/bindings-go v0.0.94 github.com/gardener/image-vector v0.10.0 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v1.2.3 diff --git a/go.sum b/go.sum index f1ce8fdc..e1ff3755 100644 --- a/go.sum +++ b/go.sum @@ -142,8 +142,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gardener/component-spec/bindings-go v0.0.52/go.mod h1:kQFMTWowNAp9tOp6aImQa/NoLzfvX29jN5Qgud9rpQU= -github.com/gardener/component-spec/bindings-go v0.0.90 h1:N8VcBifjRPzrtxxyuTvKzuSUd6wnXCgNYUtyLcTUq5k= -github.com/gardener/component-spec/bindings-go v0.0.90/go.mod h1:qr7kADDXbXB0huul+ih/B43YkwyiMFYQepp/tqJ331c= +github.com/gardener/component-spec/bindings-go v0.0.94 h1:mwhS3lpT8FFu/LAkkWTA7MVVw3RwoXaHeGPL1LchzNc= +github.com/gardener/component-spec/bindings-go v0.0.94/go.mod h1:qr7kADDXbXB0huul+ih/B43YkwyiMFYQepp/tqJ331c= github.com/gardener/image-vector v0.10.0 h1:Ysg3hxfiGUG/doajiZ0nQuUaJYwfO5BZCOcijL3tRuo= github.com/gardener/image-vector v0.10.0/go.mod h1:32SHGcbmmueeK9VkawsFcEbsoENXQPIuuYiFBUP+vMQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/vendor/github.com/gardener/component-spec/bindings-go/apis/v2/jsonscheme/bindata.go b/vendor/github.com/gardener/component-spec/bindings-go/apis/v2/jsonscheme/bindata.go index ca7253f1..2920f940 100644 --- a/vendor/github.com/gardener/component-spec/bindings-go/apis/v2/jsonscheme/bindata.go +++ b/vendor/github.com/gardener/component-spec/bindings-go/apis/v2/jsonscheme/bindata.go @@ -4,7 +4,6 @@ package jsonscheme - import ( "bytes" "compress/gzip" @@ -37,7 +36,6 @@ func bindataRead(data []byte, name string) ([]byte, error) { return buf.Bytes(), nil } - type asset struct { bytes []byte info fileInfoEx @@ -87,8 +85,6 @@ func LanguageIndependentComponentDescriptorV2SchemaYamlBytes() ([]byte, error) { ) } - - func LanguageIndependentComponentDescriptorV2SchemaYaml() (*asset, error) { bytes, err := LanguageIndependentComponentDescriptorV2SchemaYamlBytes() if err != nil { @@ -96,11 +92,11 @@ func LanguageIndependentComponentDescriptorV2SchemaYaml() (*asset, error) { } info := bindataFileInfo{ - name: "../../../../language-independent/component-descriptor-v2-schema.yaml", - size: 10026, + name: "../../../../language-independent/component-descriptor-v2-schema.yaml", + size: 10026, md5checksum: "", - mode: os.FileMode(420), - modTime: time.Unix(1681220532, 0), + mode: os.FileMode(420), + modTime: time.Unix(1681220532, 0), } a := &asset{bytes: bytes, info: info} @@ -108,7 +104,6 @@ func LanguageIndependentComponentDescriptorV2SchemaYaml() (*asset, error) { return a, nil } - // // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or @@ -199,18 +194,18 @@ func AssetDir(name string) ([]string, error) { node = node.Children[p] if node == nil { return nil, &os.PathError{ - Op: "open", + Op: "open", Path: name, - Err: os.ErrNotExist, + Err: os.ErrNotExist, } } } } if node.Func != nil { return nil, &os.PathError{ - Op: "open", + Op: "open", Path: name, - Err: os.ErrNotExist, + Err: os.ErrNotExist, } } rv := make([]string, 0, len(node.Children)) @@ -220,7 +215,6 @@ func AssetDir(name string) ([]string, error) { return rv, nil } - type bintree struct { Func func() (*asset, error) Children map[string]*bintree diff --git a/vendor/github.com/gardener/component-spec/bindings-go/oci/constants.go b/vendor/github.com/gardener/component-spec/bindings-go/oci/constants.go index f647c51f..416ee806 100644 --- a/vendor/github.com/gardener/component-spec/bindings-go/oci/constants.go +++ b/vendor/github.com/gardener/component-spec/bindings-go/oci/constants.go @@ -14,6 +14,10 @@ package oci +// ComponentDescriptorTarMimeTypeOCM is the new OCM mimetype for component-descriptor-blobs +// that are stored as tar. +const ComponentDescriptorTarMimeTypeOCM = "application/vnd.ocm.software.component-descriptor.v2+yaml+tar" + // ComponentDescriptorTarMimeType is the old mimetype for component-descriptor-blobs // that are stored as tar. const ComponentDescriptorTarMimeType = "application/vnd.gardener.cloud.cnudie.component-descriptor.v2+yaml+tar" @@ -35,7 +39,10 @@ var ComponentDescriptorMimeType = []string{ ComponentDescriptorJSONMimeType, } -// ComponentDescriptorConfigMimeType is the mimetype for component-descriptor-oci-cfg-blobs. +// ComponentDescriptorConfigMimeType is the new OCM mimetype for component-descriptor-oci-cfg-blobs. +const ComponentDescriptorConfigMimeTypeOCM = "application/vnd.ocm.software.component.config.v1+json" + +// ComponentDescriptorConfigMimeType is the deprecated mimetype for component-descriptor-oci-cfg-blobs. const ComponentDescriptorConfigMimeType = "application/vnd.gardener.cloud.cnudie.component.config.v1+json" // ComponentDescriptorLegacyConfigMimeType is the mimetype for the legacy component-descriptor-oci-cfg-blobs diff --git a/vendor/github.com/gardener/component-spec/bindings-go/oci/manifest.go b/vendor/github.com/gardener/component-spec/bindings-go/oci/manifest.go index f04cc44a..6c0e8544 100644 --- a/vendor/github.com/gardener/component-spec/bindings-go/oci/manifest.go +++ b/vendor/github.com/gardener/component-spec/bindings-go/oci/manifest.go @@ -41,8 +41,8 @@ type BlobStore interface { // ManifestBuilder converts a component descriptor with local defined blobs // into a oci component descriptor with blobs as layers of the component descriptor. type ManifestBuilder struct { - store BlobStore - archive *ctf.ComponentArchive + store BlobStore + archive *ctf.ComponentArchive componentDescriptorStorageType string } @@ -122,15 +122,15 @@ func (b *ManifestBuilder) addComponentDescriptorDesc() (ocispecv1.Descriptor, er return ocispecv1.Descriptor{}, fmt.Errorf("unable to add component descriptor layer to internal store: %w", err) } return componentDescriptorDesc, nil - } else if b.componentDescriptorStorageType == ComponentDescriptorTarMimeType { + } else if b.componentDescriptorStorageType == ComponentDescriptorTarMimeType || b.componentDescriptorStorageType == ComponentDescriptorTarMimeTypeOCM { // create tar with component descriptor var buf bytes.Buffer tw := tar.NewWriter(&buf) if err := tw.WriteHeader(&tar.Header{ - Typeflag: tar.TypeReg, - Name: ctf.ComponentDescriptorFileName, - Size: int64(len(data)), - ModTime: time.Now(), + Typeflag: tar.TypeReg, + Name: ctf.ComponentDescriptorFileName, + Size: int64(len(data)), + ModTime: time.Now(), }); err != nil { return ocispecv1.Descriptor{}, fmt.Errorf("unable to add component descriptor header: %w", err) } diff --git a/vendor/github.com/gardener/component-spec/bindings-go/oci/resolve.go b/vendor/github.com/gardener/component-spec/bindings-go/oci/resolve.go index a89bc4cd..ca44b37d 100644 --- a/vendor/github.com/gardener/component-spec/bindings-go/oci/resolve.go +++ b/vendor/github.com/gardener/component-spec/bindings-go/oci/resolve.go @@ -198,7 +198,7 @@ func (r *Resolver) resolve(ctx context.Context, repoCtx v2.Repository, name, ver componentDescriptorBytes := componentDescriptorLayerBytes.Bytes() switch componentDescriptorLayer.MediaType { - case ComponentDescriptorTarMimeType, LegacyComponentDescriptorTarMimeType: + case ComponentDescriptorTarMimeTypeOCM, ComponentDescriptorTarMimeType, LegacyComponentDescriptorTarMimeType: componentDescriptorBytes, err = ReadComponentDescriptorFromTar(&componentDescriptorLayerBytes) if err != nil { return nil, nil, fmt.Errorf("unable to read component descriptor from tar: %w", err) @@ -264,8 +264,8 @@ func (r *Resolver) ToComponentArchive(ctx context.Context, repoCtx v2.Repository func (r *Resolver) getComponentConfig(ctx context.Context, ref string, manifest *ocispecv1.Manifest) (*ComponentDescriptorConfig, error) { if manifest.Config.MediaType != ComponentDescriptorConfigMimeType && - manifest.Config.MediaType != ComponentDescriptorLegacyConfigMimeType { - return nil, fmt.Errorf("unknown component config type '%s' expected '%s'", manifest.Config.MediaType, ComponentDescriptorConfigMimeType) + manifest.Config.MediaType != ComponentDescriptorLegacyConfigMimeType && manifest.Config.MediaType != ComponentDescriptorConfigMimeTypeOCM { + return nil, fmt.Errorf("unknown component config type '%s' expected '%s' or '%s'", manifest.Config.MediaType, ComponentDescriptorConfigMimeType, ComponentDescriptorConfigMimeTypeOCM) } var data bytes.Buffer diff --git a/vendor/modules.txt b/vendor/modules.txt index 206a8f23..780d0edb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -52,7 +52,7 @@ github.com/drone/envsubst/path # github.com/fsnotify/fsnotify v1.4.9 ## explicit; go 1.13 github.com/fsnotify/fsnotify -# github.com/gardener/component-spec/bindings-go v0.0.90 +# github.com/gardener/component-spec/bindings-go v0.0.94 ## explicit; go 1.18 github.com/gardener/component-spec/bindings-go/apis github.com/gardener/component-spec/bindings-go/apis/v2