ensure error is correctly handled when generating chart's oci manifest

Signed-off-by: Josh Wolf <josh@joshwolf.dev>
This commit is contained in:
Josh Wolf 2021-11-05 11:01:14 -06:00
parent d2d8e52401
commit fae5009382
1 changed files with 5 additions and 2 deletions

View File

@ -242,7 +242,6 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
oras.WithLayerDescriptors(func(l []ocispec.Descriptor) {
layers = l
}))
if err != nil {
fmt.Println(err)
return nil, err
@ -456,7 +455,11 @@ func (c *Client) Push(data []byte, ref string, options ...PushOption) (*PushResu
}
manifestData, manifest, err := content.GenerateManifest(&configDescriptor, nil, descriptors...)
if err = memoryStore.StoreManifest(ref, manifest, manifestData); err != nil {
if err != nil {
return nil, err
}
if err := memoryStore.StoreManifest(ref, manifest, manifestData); err != nil {
return nil, err
}