From e79eb4dd48a3007c497968c0b1b121a791653a29 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Mon, 17 Jul 2023 11:49:13 -0600 Subject: [PATCH 1/2] Use hello-world image instead of alpine: The TestDockerImageNotPresent can fail if the alpine image is being used by a started container. The hello-world image might be a safer option. Signed-off-by: Jacob Weinstock --- internal/agent/runtime/docker_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/agent/runtime/docker_test.go b/internal/agent/runtime/docker_test.go index 4237d6cbe..3a38ae7e9 100644 --- a/internal/agent/runtime/docker_test.go +++ b/internal/agent/runtime/docker_test.go @@ -27,7 +27,7 @@ func TestDockerImageNotPresent(t *testing.T) { t.Fatalf("Received unexpected error: %v", err) } - image := "alpine" + image := "hello-world" images, err := clnt.ImageList(context.Background(), types.ImageListOptions{ Filters: filters.NewArgs(filters.Arg("reference", image)), From 7b5ba2b8d7ad0727894965fb445ff26f050ec52b Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Mon, 17 Jul 2023 11:50:19 -0600 Subject: [PATCH 2/2] Add additional device naming formats to formatPartition func: This allows for using the formatPartition func for more device types. `vd*` is a device created by virtio. `hd*` for legacy IDE hard disks. Signed-off-by: Jacob Weinstock --- internal/workflow/template_funcs.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/workflow/template_funcs.go b/internal/workflow/template_funcs.go index c6af8e5d8..46d39fa5c 100644 --- a/internal/workflow/template_funcs.go +++ b/internal/workflow/template_funcs.go @@ -20,11 +20,12 @@ var templateFuncs = map[string]interface{}{ // // formatPartition("/dev/nvme0n1", 0) -> /dev/nvme0n1p1 // formatPartition("/dev/sda", 1) -> /dev/sda1 +// formatPartition("/dev/vda", 2) -> /dev/vda2 func formatPartition(dev string, partition int) string { switch { case strings.HasPrefix(dev, "/dev/nvme"): return fmt.Sprintf("%vp%v", dev, partition) - case strings.HasPrefix(dev, "/dev/sd"): + case strings.HasPrefix(dev, "/dev/sd"), strings.HasPrefix(dev, "/dev/vd"), strings.HasPrefix(dev, "/dev/hd"): return fmt.Sprintf("%v%v", dev, partition) } return dev