|
|
@ -395,8 +395,9 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
|
|
|
|
|
|
|
|
|
|
|
|
numDescriptors := len(descriptors)
|
|
|
|
numDescriptors := len(descriptors)
|
|
|
|
if numDescriptors < minNumDescriptors {
|
|
|
|
if numDescriptors < minNumDescriptors {
|
|
|
|
return nil, fmt.Errorf("manifest does not contain minimum number of descriptors (%d), descriptors found: %d",
|
|
|
|
return nil, errors.New(
|
|
|
|
minNumDescriptors, numDescriptors)
|
|
|
|
fmt.Sprintf("manifest does not contain minimum number of descriptors (%d), descriptors found: %d",
|
|
|
|
|
|
|
|
minNumDescriptors, numDescriptors))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var configDescriptor *ocispec.Descriptor
|
|
|
|
var configDescriptor *ocispec.Descriptor
|
|
|
|
var chartDescriptor *ocispec.Descriptor
|
|
|
|
var chartDescriptor *ocispec.Descriptor
|
|
|
@ -416,19 +417,22 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if configDescriptor == nil {
|
|
|
|
if configDescriptor == nil {
|
|
|
|
return nil, fmt.Errorf("could not load config with mediatype %s", ConfigMediaType)
|
|
|
|
return nil, errors.New(
|
|
|
|
|
|
|
|
fmt.Sprintf("could not load config with mediatype %s", ConfigMediaType))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if operation.withChart && chartDescriptor == nil {
|
|
|
|
if operation.withChart && chartDescriptor == nil {
|
|
|
|
return nil, fmt.Errorf("manifest does not contain a layer with mediatype %s",
|
|
|
|
return nil, errors.New(
|
|
|
|
ChartLayerMediaType)
|
|
|
|
fmt.Sprintf("manifest does not contain a layer with mediatype %s",
|
|
|
|
|
|
|
|
ChartLayerMediaType))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var provMissing bool
|
|
|
|
var provMissing bool
|
|
|
|
if operation.withProv && provDescriptor == nil {
|
|
|
|
if operation.withProv && provDescriptor == nil {
|
|
|
|
if operation.ignoreMissingProv {
|
|
|
|
if operation.ignoreMissingProv {
|
|
|
|
provMissing = true
|
|
|
|
provMissing = true
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return nil, fmt.Errorf("manifest does not contain a layer with mediatype %s",
|
|
|
|
return nil, errors.New(
|
|
|
|
ProvLayerMediaType)
|
|
|
|
fmt.Sprintf("manifest does not contain a layer with mediatype %s",
|
|
|
|
|
|
|
|
ProvLayerMediaType))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result := &PullResult{
|
|
|
|
result := &PullResult{
|
|
|
|