diff options
author | Franck Cuny <franck@fcuny.net> | 2021-05-15 13:16:25 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2021-05-15 13:16:25 -0700 |
commit | ed88f7ad79dd3e331525e965cb06df43d982d4eb (patch) | |
tree | d6ce3479492be1d9a77078baa1ba4b962ba99b9d /cmd | |
parent | github: add workflows (diff) | |
download | containerd-to-vm-ed88f7ad79dd3e331525e965cb06df43d982d4eb.tar.gz |
check for error
When reading the configuration for the container, if there's an error we return the error to the caller.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/c2vm/main.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/c2vm/main.go b/cmd/c2vm/main.go index 544293e..3251f96 100644 --- a/cmd/c2vm/main.go +++ b/cmd/c2vm/main.go @@ -187,6 +187,9 @@ func initScript(ctx context.Context, client *containerd.Client, image containerd } configBlob, err := content.ReadBlob(ctx, client.ContentStore(), config) + if err != nil { + return err + } var imageSpec ocispec.Image json.Unmarshal(configBlob, &imageSpec) initCmd := strings.Join(imageSpec.Config.Cmd, " ") |