From 459a2f908025944efc97e754d0a211136dad1570 Mon Sep 17 00:00:00 2001 From: peefy Date: Mon, 28 Aug 2023 11:47:09 +0800 Subject: [PATCH] chore: use kpm error event in the ReadFromOCISource function. --- pkg/source/oci.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/source/oci.go b/pkg/source/oci.go index fb1ec13..6558b85 100644 --- a/pkg/source/oci.go +++ b/pkg/source/oci.go @@ -48,10 +48,9 @@ func ReadFromOCISource(src string) (string, error) { localPath := ociOpts.AddStoragePathSuffix(tmpDir) // 2. Pull the tarball from OCI. - err = oci.Pull(localPath, ociOpts.Reg, ociOpts.Repo, ociOpts.Tag) - - if err != nil { - return src, err + e = oci.Pull(localPath, ociOpts.Reg, ociOpts.Repo, ociOpts.Tag) + if e != nil { + return src, errors.New(e.Error()) } // 3. Get the (*.tar) file path.