ref(helm): export DescriptorPullSummary fields

Exporting those fields enable 3rd party users to build their own mocked PullResult responses.

Related #10623

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
pull/11129/head
Antonio Gamez Diaz 3 years ago
parent 80bc7df782
commit 62be6f1af6
No known key found for this signature in database
GPG Key ID: 96108DED40068D35

@ -248,21 +248,21 @@ type (
// PullResult is the result returned upon successful pull. // PullResult is the result returned upon successful pull.
PullResult struct { PullResult struct {
Manifest *descriptorPullSummary `json:"manifest"` Manifest *DescriptorPullSummary `json:"manifest"`
Config *descriptorPullSummary `json:"config"` Config *DescriptorPullSummary `json:"config"`
Chart *descriptorPullSummaryWithMeta `json:"chart"` Chart *DescriptorPullSummaryWithMeta `json:"chart"`
Prov *descriptorPullSummary `json:"prov"` Prov *DescriptorPullSummary `json:"prov"`
Ref string `json:"ref"` Ref string `json:"ref"`
} }
descriptorPullSummary struct { DescriptorPullSummary struct {
Data []byte `json:"-"` Data []byte `json:"-"`
Digest string `json:"digest"` Digest string `json:"digest"`
Size int64 `json:"size"` Size int64 `json:"size"`
} }
descriptorPullSummaryWithMeta struct { DescriptorPullSummaryWithMeta struct {
descriptorPullSummary DescriptorPullSummary
Meta *chart.Metadata `json:"meta"` Meta *chart.Metadata `json:"meta"`
} }
@ -361,16 +361,16 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
} }
} }
result := &PullResult{ result := &PullResult{
Manifest: &descriptorPullSummary{ Manifest: &DescriptorPullSummary{
Digest: manifest.Digest.String(), Digest: manifest.Digest.String(),
Size: manifest.Size, Size: manifest.Size,
}, },
Config: &descriptorPullSummary{ Config: &DescriptorPullSummary{
Digest: configDescriptor.Digest.String(), Digest: configDescriptor.Digest.String(),
Size: configDescriptor.Size, Size: configDescriptor.Size,
}, },
Chart: &descriptorPullSummaryWithMeta{}, Chart: &DescriptorPullSummaryWithMeta{},
Prov: &descriptorPullSummary{}, Prov: &DescriptorPullSummary{},
Ref: parsedRef.String(), Ref: parsedRef.String(),
} }
var getManifestErr error var getManifestErr error

Loading…
Cancel
Save