From 0b28ab9e5783b98156f2770cdf1836b8efa44d48 Mon Sep 17 00:00:00 2001 From: fupan Date: Sat, 5 Jan 2019 17:50:47 +0800 Subject: [PATCH] shimv2: get the kata configure file from env KATA_CONF_FILE If the env KATA_CONF_FILE was set, shimv2 will use it as the kata configure file, otherwise, it will try to find it from /etc and /usr/share directory. Fixes: #1091 Signed-off-by: fupan --- containerd-shim-v2/service.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/containerd-shim-v2/service.go b/containerd-shim-v2/service.go index f1790b8a23..6990a863a5 100644 --- a/containerd-shim-v2/service.go +++ b/containerd-shim-v2/service.go @@ -63,7 +63,10 @@ func New(ctx context.Context, id string, publisher events.Publisher) (cdshim.Shi logrus.SetOutput(ioutil.Discard) vci.SetLogger(ctx, logger) katautils.SetLogger(ctx, logger, logger.Logger.Level) - _, runtimeConfig, err := katautils.LoadConfiguration("", false, true) + + // Try to get the config file from the env KATA_CONF_FILE + confPath := os.Getenv("KATA_CONF_FILE") + _, runtimeConfig, err := katautils.LoadConfiguration(confPath, false, true) if err != nil { return nil, err }