Skip to content

Commit

Permalink
changes to support any mediatype for layers on download
Browse files Browse the repository at this point in the history
Signed-off-by: LochanRn <rajanaga_ra@srmuniv.edu.in>
(cherry picked from commit 9e29f16)
  • Loading branch information
LochanRn authored and mattfarina committed Oct 13, 2021
1 parent 2aacc5f commit 52fbd4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/experimental/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
minNumDescriptors := 1 // 1 for the config
if operation.withChart {
minNumDescriptors++
allowedMediaTypes = append(allowedMediaTypes, ChartLayerMediaType)
allowedMediaTypes = append(allowedMediaTypes, ChartLayerMediaType, LegacyChartLayerMediaType)
}
if operation.withProv {
if !operation.ignoreMissingProv {
Expand Down Expand Up @@ -256,6 +256,9 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
chartDescriptor = &d
case ProvLayerMediaType:
provDescriptor = &d
case LegacyChartLayerMediaType:
chartDescriptor = &d
fmt.Fprintf(c.out, "Warning: chart media type %s is deprecated\n", LegacyChartLayerMediaType)
}
}
if configDescriptor == nil {
Expand Down
3 changes: 3 additions & 0 deletions internal/experimental/registry/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ const (

// ProvLayerMediaType is the reserved media type for Helm chart provenance files
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"
)

0 comments on commit 52fbd4e

Please sign in to comment.