mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 11:06:21 +00:00
runtime: add GetSandboxesStoragePath()
The storage path we use to collect the sandbox files is defined in the
virtcontainers/persist/fs package.
We create the runtime socket in that storage path, by hardcoding the
full path in the SocketAddress() function in the runtime package.
This commit splits the hardcoded path by the socket address path so that
the runtime package will be able to provide the storage path to all the
components that may need it.
Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
(cherry picked from commit e38686f74d
)
This commit is contained in:
parent
fc1822f094
commit
623b108227
@ -183,8 +183,13 @@ func (s *service) mountPprofHandle(m *http.ServeMux, ociSpec *specs.Spec) {
|
|||||||
m.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
|
m.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
|
||||||
}
|
}
|
||||||
|
|
||||||
// SocketAddress returns the address of the abstract domain socket for communicating with the
|
// GetSandboxesStoragePath returns the storage path where sandboxes info are stored
|
||||||
|
func GetSanboxesStoragePath() 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
|
// shim management endpoint
|
||||||
func SocketAddress(id string) string {
|
func SocketAddress(id string) string {
|
||||||
return fmt.Sprintf("unix://%s", filepath.Join(string(filepath.Separator), "run", "vc", "sbs", id, "shim-monitor.sock"))
|
return fmt.Sprintf("unix://%s", filepath.Join(string(filepath.Separator), GetSanboxesStoragePath(), id, "shim-monitor.sock"))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user