From 1b6affe498162d6f00e4a4ad1987b9220dc5de5e Mon Sep 17 00:00:00 2001 From: Ace-Tang Date: Thu, 28 Mar 2019 19:07:15 +0800 Subject: [PATCH] config: fix panic in type assertion when use shim v2 interface to run container, no need to use kata-proxy and kata-shim, remove kata-proxy and kata-shim in config file will cause panic since type assertion. add check to avoid panic Fixes: #1440 Signed-off-by: Ace-Tang --- pkg/katautils/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/katautils/config.go b/pkg/katautils/config.go index 28282f145c..0f1697398b 100644 --- a/pkg/katautils/config.go +++ b/pkg/katautils/config.go @@ -935,7 +935,7 @@ func checkNetNsConfig(config oci.RuntimeConfig) error { if config.InterNetworkModel != vc.NetXConnectNoneModel { return fmt.Errorf("config disable_new_netns only works with 'none' internetworking_model") } - } else if config.ShimConfig.(vc.ShimConfig).Trace { + } else if shim, ok := config.ShimConfig.(vc.ShimConfig); ok && shim.Trace { // Normally, the shim runs in a separate network namespace. // But when tracing, the shim process needs to be able to talk // to the Jaeger agent running in the host network namespace.