Skip to content

Commit c5383af

Browse files
author
zhouhao
committed
Increase unpack type error judgment
Signed-off-by: zhouhao <[email protected]>
1 parent 0a1e5dc commit c5383af

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/oci-create-runtime-bundle/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ func (v *bundleCmd) Run(cmd *cobra.Command, args []string) {
130130

131131
case image.TypeImage:
132132
err = image.CreateRuntimeBundle(args[0], args[1], v.ref, v.root)
133+
134+
default:
135+
err = fmt.Errorf("cannot create %q", v.typ)
136+
133137
}
134138

135139
if err != nil {

cmd/oci-unpack/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ func (v *unpackCmd) Run(cmd *cobra.Command, args []string) {
117117

118118
case image.TypeImage:
119119
err = image.Unpack(args[0], args[1], v.ref)
120+
121+
default:
122+
err = fmt.Errorf("cannot unpack %q", v.typ)
120123
}
121124

122125
if err != nil {

0 commit comments

Comments
 (0)