|
|
@ -19,6 +19,7 @@ package registry // import "helm.sh/helm/v3/pkg/registry"
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"encoding/json"
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
@ -28,7 +29,6 @@ import (
|
|
|
|
"github.com/Masterminds/semver/v3"
|
|
|
|
"github.com/Masterminds/semver/v3"
|
|
|
|
"github.com/containerd/containerd/remotes"
|
|
|
|
"github.com/containerd/containerd/remotes"
|
|
|
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
|
|
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
|
|
|
|
"oras.land/oras-go/pkg/auth"
|
|
|
|
"oras.land/oras-go/pkg/auth"
|
|
|
|
dockerauth "oras.land/oras-go/pkg/auth/docker"
|
|
|
|
dockerauth "oras.land/oras-go/pkg/auth/docker"
|
|
|
|
"oras.land/oras-go/pkg/content"
|
|
|
|
"oras.land/oras-go/pkg/content"
|
|
|
@ -392,7 +392,7 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var getManifestErr error
|
|
|
|
var getManifestErr error
|
|
|
|
if _, manifestData, ok := memoryStore.Get(manifest); !ok {
|
|
|
|
if _, manifestData, ok := memoryStore.Get(manifest); !ok {
|
|
|
|
getManifestErr = errors.Errorf("Unable to retrieve blob with digest %s", manifest.Digest)
|
|
|
|
getManifestErr = fmt.Errorf("Unable to retrieve blob with digest %s", manifest.Digest)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
result.Manifest.Data = manifestData
|
|
|
|
result.Manifest.Data = manifestData
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -401,7 +401,7 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var getConfigDescriptorErr error
|
|
|
|
var getConfigDescriptorErr error
|
|
|
|
if _, configData, ok := memoryStore.Get(*configDescriptor); !ok {
|
|
|
|
if _, configData, ok := memoryStore.Get(*configDescriptor); !ok {
|
|
|
|
getConfigDescriptorErr = errors.Errorf("Unable to retrieve blob with digest %s", configDescriptor.Digest)
|
|
|
|
getConfigDescriptorErr = fmt.Errorf("Unable to retrieve blob with digest %s", configDescriptor.Digest)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
result.Config.Data = configData
|
|
|
|
result.Config.Data = configData
|
|
|
|
var meta *chart.Metadata
|
|
|
|
var meta *chart.Metadata
|
|
|
@ -416,7 +416,7 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
|
|
|
|
if operation.withChart {
|
|
|
|
if operation.withChart {
|
|
|
|
var getChartDescriptorErr error
|
|
|
|
var getChartDescriptorErr error
|
|
|
|
if _, chartData, ok := memoryStore.Get(*chartDescriptor); !ok {
|
|
|
|
if _, chartData, ok := memoryStore.Get(*chartDescriptor); !ok {
|
|
|
|
getChartDescriptorErr = errors.Errorf("Unable to retrieve blob with digest %s", chartDescriptor.Digest)
|
|
|
|
getChartDescriptorErr = fmt.Errorf("Unable to retrieve blob with digest %s", chartDescriptor.Digest)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
result.Chart.Data = chartData
|
|
|
|
result.Chart.Data = chartData
|
|
|
|
result.Chart.Digest = chartDescriptor.Digest.String()
|
|
|
|
result.Chart.Digest = chartDescriptor.Digest.String()
|
|
|
@ -429,7 +429,7 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
|
|
|
|
if operation.withProv && !provMissing {
|
|
|
|
if operation.withProv && !provMissing {
|
|
|
|
var getProvDescriptorErr error
|
|
|
|
var getProvDescriptorErr error
|
|
|
|
if _, provData, ok := memoryStore.Get(*provDescriptor); !ok {
|
|
|
|
if _, provData, ok := memoryStore.Get(*provDescriptor); !ok {
|
|
|
|
getProvDescriptorErr = errors.Errorf("Unable to retrieve blob with digest %s", provDescriptor.Digest)
|
|
|
|
getProvDescriptorErr = fmt.Errorf("Unable to retrieve blob with digest %s", provDescriptor.Digest)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
result.Prov.Data = provData
|
|
|
|
result.Prov.Data = provData
|
|
|
|
result.Prov.Digest = provDescriptor.Digest.String()
|
|
|
|
result.Prov.Digest = provDescriptor.Digest.String()
|
|
|
|