From 33b347a8fbd5f004cc9d29780820414924c8c9c5 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 18 Mar 2024 11:12:52 -0700 Subject: [PATCH] oci: make mounting oci socket optional The source path changed in v0.13 and there are reports that new path can cause error on starting a container. While this is investigated, check for missing path and make mounting optional like it was in v0.12. Signed-off-by: Tonis Tiigi --- executor/oci/spec.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/executor/oci/spec.go b/executor/oci/spec.go index ee62295eb1ff..ec903bc6a610 100644 --- a/executor/oci/spec.go +++ b/executor/oci/spec.go @@ -2,6 +2,7 @@ package oci import ( "context" + "os" "path" "path/filepath" "runtime" @@ -197,8 +198,11 @@ func GenerateSpec(ctx context.Context, meta executor.Meta, mounts []executor.Mou } if tracingSocket != "" { - if mount := getTracingSocketMount(tracingSocket); mount != nil { - s.Mounts = append(s.Mounts, *mount) + // moby/buildkit#4764 + if _, err := os.Stat(tracingSocket); err == nil { + if mount := getTracingSocketMount(tracingSocket); mount != nil { + s.Mounts = append(s.Mounts, *mount) + } } }