Merge pull request #10182 from spectrocloud/oci-allow-any-media-type

changes to support any mediatype for layers on download
pull/10067/head
Matt Farina 4 years ago committed by GitHub
commit 81f0df0ea6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -224,7 +224,7 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
minNumDescriptors := 1 // 1 for the config minNumDescriptors := 1 // 1 for the config
if operation.withChart { if operation.withChart {
minNumDescriptors++ minNumDescriptors++
allowedMediaTypes = append(allowedMediaTypes, ChartLayerMediaType) allowedMediaTypes = append(allowedMediaTypes, ChartLayerMediaType, LegacyChartLayerMediaType)
} }
if operation.withProv { if operation.withProv {
if !operation.ignoreMissingProv { if !operation.ignoreMissingProv {
@ -256,6 +256,9 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
chartDescriptor = &d chartDescriptor = &d
case ProvLayerMediaType: case ProvLayerMediaType:
provDescriptor = &d provDescriptor = &d
case LegacyChartLayerMediaType:
chartDescriptor = &d
fmt.Fprintf(c.out, "Warning: chart media type %s is deprecated\n", LegacyChartLayerMediaType)
} }
} }
if configDescriptor == nil { if configDescriptor == nil {

@ -31,4 +31,7 @@ const (
// ProvLayerMediaType is the reserved media type for Helm chart provenance files // ProvLayerMediaType is the reserved media type for Helm chart provenance files
ProvLayerMediaType = "application/vnd.cncf.helm.chart.provenance.v1.prov" ProvLayerMediaType = "application/vnd.cncf.helm.chart.provenance.v1.prov"
// LegacyChartLayerMediaType is the legacy reserved media type for Helm chart package content.
LegacyChartLayerMediaType = "application/tar+gzip"
) )

Loading…
Cancel
Save