containerd/cmd
Kevin Parsons 5f051c1d71 Improve error detection when loading config
Previously we simply ignored any not found error when loading the
containerd config. This created unintuitive behavior:

- If the user specified a path that didn't exist via --config, we would
  silently ignore the error.
- If a config specified an import that didn't exist, we would silently
  ignore the error.

In either of these cases, it appears we would end up using a potentially
corrupted config, as it would contain any files that were merged into it
before the not found error was hit.

However, we can't just remove the check for !os.IsNotExist(err),
as we shouldn't throw an error when --config is not passed, but the
default config doesn't exist.

This change updates the logic to only attempt to load the config if
we know it exists, or the user passed --config.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2021-02-09 16:21:32 -08:00
..
containerd Improve error detection when loading config 2021-02-09 16:21:32 -08:00
containerd-shim Compile for FreeBSD 2020-12-09 00:30:29 -08:00
containerd-shim-runc-v1 Fix linter errors 2019-07-14 20:49:40 -07:00
containerd-shim-runc-v2 Fix linter errors 2019-07-14 20:49:40 -07:00
containerd-stress Fix density spec generation 2019-09-17 16:21:25 -04:00
ctr Add prune command to remove layer references 2021-01-23 10:52:24 -08:00
gen-manpages man: move ctr.1, containerd-config to section 8, and fix generation 2020-04-03 12:32:52 +02:00
protoc-gen-gogoctrd Update ttrpc for containerd repo 2018-06-28 09:53:40 -04:00