From 315295e0ef9c18eb3b1d42877dc33ac01abeef70 Mon Sep 17 00:00:00 2001 From: Francesco Giudici Date: Mon, 27 Sep 2021 15:48:32 +0200 Subject: [PATCH 1/2] runtime: rename GetSanboxesStoragePath() --> GetSandboxesStoragePath() Add the missing 'd'. Fixes: #2738 Suggested-by: Jakob Naucke Signed-off-by: Francesco Giudici --- src/runtime/pkg/containerd-shim-v2/shim_management.go | 4 ++-- src/runtime/pkg/kata-monitor/shim_client.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/pkg/containerd-shim-v2/shim_management.go b/src/runtime/pkg/containerd-shim-v2/shim_management.go index 05b2283005..81d9380438 100644 --- a/src/runtime/pkg/containerd-shim-v2/shim_management.go +++ b/src/runtime/pkg/containerd-shim-v2/shim_management.go @@ -184,12 +184,12 @@ func (s *service) mountPprofHandle(m *http.ServeMux, ociSpec *specs.Spec) { } // GetSandboxesStoragePath returns the storage path where sandboxes info are stored -func GetSanboxesStoragePath() string { +func GetSandboxesStoragePath() string { return filepath.Join(string(filepath.Separator), "run", "vc", "sbs") } // SocketAddress returns the address of the unix domain socket for communicating with the // shim management endpoint func SocketAddress(id string) string { - return fmt.Sprintf("unix://%s", filepath.Join(string(filepath.Separator), GetSanboxesStoragePath(), id, "shim-monitor.sock")) + return fmt.Sprintf("unix://%s", filepath.Join(string(filepath.Separator), GetSandboxesStoragePath(), id, "shim-monitor.sock")) } diff --git a/src/runtime/pkg/kata-monitor/shim_client.go b/src/runtime/pkg/kata-monitor/shim_client.go index 9f3937472f..c47211e52a 100644 --- a/src/runtime/pkg/kata-monitor/shim_client.go +++ b/src/runtime/pkg/kata-monitor/shim_client.go @@ -40,7 +40,7 @@ func getSandboxIDFromReq(r *http.Request) (string, error) { } func getSandboxFS() string { - return shim.GetSanboxesStoragePath() + return shim.GetSandboxesStoragePath() } func checkSandboxFSExists(sandboxID string) bool { From 2304a59601fb509060c9663232a0b0d4dcc0f34b Mon Sep 17 00:00:00 2001 From: Francesco Giudici Date: Mon, 27 Sep 2021 15:57:34 +0200 Subject: [PATCH 2/2] runtime: set the sandbox storage path static Since we now have "unix://" kind of socket returned by the SocketAddress() function, there is no more need to build the sandbox storage path dynamically to keep OS compatibility. Fixes: #2738 Suggested-by: Christophe de Dinechin Signed-off-by: Francesco Giudici --- src/runtime/pkg/containerd-shim-v2/shim_management.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/pkg/containerd-shim-v2/shim_management.go b/src/runtime/pkg/containerd-shim-v2/shim_management.go index 81d9380438..5ccf03304c 100644 --- a/src/runtime/pkg/containerd-shim-v2/shim_management.go +++ b/src/runtime/pkg/containerd-shim-v2/shim_management.go @@ -185,7 +185,7 @@ func (s *service) mountPprofHandle(m *http.ServeMux, ociSpec *specs.Spec) { // GetSandboxesStoragePath returns the storage path where sandboxes info are stored func GetSandboxesStoragePath() string { - return filepath.Join(string(filepath.Separator), "run", "vc", "sbs") + return "/run/vc/sbs" } // SocketAddress returns the address of the unix domain socket for communicating with the