From c41c9de839a501f718c2424754479e09e5303a10 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Mon, 13 Aug 2018 17:15:32 +0800 Subject: [PATCH] proxy: do not decode proxy config It is a well defined structure that needs no decoding. Signed-off-by: Peng Tao --- virtcontainers/proxy.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/virtcontainers/proxy.go b/virtcontainers/proxy.go index 4af852254f..f2f55f8a82 100644 --- a/virtcontainers/proxy.go +++ b/virtcontainers/proxy.go @@ -9,7 +9,6 @@ import ( "fmt" "path/filepath" - "github.com/mitchellh/mapstructure" "github.com/sirupsen/logrus" ) @@ -132,9 +131,9 @@ func newProxyConfig(sandboxConfig *SandboxConfig) (ProxyConfig, error) { case KataProxyType: fallthrough case CCProxyType: - if err := mapstructure.Decode(sandboxConfig.ProxyConfig, &config); err != nil { - return ProxyConfig{}, err - } + config = sandboxConfig.ProxyConfig + default: + return ProxyConfig{}, fmt.Errorf("unknown proxy type %v", sandboxConfig.ProxyType) } if config.Path == "" {