about summary refs log tree commit diff
path: root/users/fcuny/exp/containerd-to-vm
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2021-05-15 13:16:25 -0700
committerFranck Cuny <franck@fcuny.net>2022-06-11 13:57:42 -0700
commit307aec5d526966888ef923bd531dfeb91a7f2b08 (patch)
tree56562cdf9f7323a553943b9f63417826acd36dbe /users/fcuny/exp/containerd-to-vm
parentgithub: add workflows (diff)
downloadworld-307aec5d526966888ef923bd531dfeb91a7f2b08.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 'users/fcuny/exp/containerd-to-vm')
-rw-r--r--users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go b/users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go
index 544293e..3251f96 100644
--- a/users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go
+++ b/users/fcuny/exp/containerd-to-vm/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, " ")