From 8ea19b5818d0c1e9b798bd0bd288c7f51a46261d Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Thu, 17 Dec 2020 10:44:44 -0800 Subject: Add sandbox ID to state file name This allows to find all containers inside a sandbox more efficiently. This operation is required every time a container starts and stops, and previously required loading *all* container state files to check whether the container belonged to the sandbox. Apert from being inneficient, it has caused problems when state files are stale or corrupt, causing inavalability to create any container. Also adjust commands `list` and `debug` to skip over files that fail to load. Resolves #5052 PiperOrigin-RevId: 348050637 --- runsc/cmd/ps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runsc/cmd/ps.go') diff --git a/runsc/cmd/ps.go b/runsc/cmd/ps.go index 18d7a1436..04e3e0bdd 100644 --- a/runsc/cmd/ps.go +++ b/runsc/cmd/ps.go @@ -60,7 +60,7 @@ func (ps *PS) Execute(ctx context.Context, f *flag.FlagSet, args ...interface{}) id := f.Arg(0) conf := args[0].(*config.Config) - c, err := container.LoadAndCheck(conf.RootDir, id) + c, err := container.Load(conf.RootDir, container.FullID{ContainerID: id}, container.LoadOpts{}) if err != nil { Fatalf("loading sandbox: %v", err) } -- cgit v1.2.3