proxy: do not decode proxy config

It is a well defined structure that needs no decoding.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
Peng Tao 2018-08-13 17:15:32 +08:00
parent 22aedc4fb6
commit c41c9de839

View File

@ -9,7 +9,6 @@ import (
"fmt" "fmt"
"path/filepath" "path/filepath"
"github.com/mitchellh/mapstructure"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -132,9 +131,9 @@ func newProxyConfig(sandboxConfig *SandboxConfig) (ProxyConfig, error) {
case KataProxyType: case KataProxyType:
fallthrough fallthrough
case CCProxyType: case CCProxyType:
if err := mapstructure.Decode(sandboxConfig.ProxyConfig, &config); err != nil { config = sandboxConfig.ProxyConfig
return ProxyConfig{}, err default:
} return ProxyConfig{}, fmt.Errorf("unknown proxy type %v", sandboxConfig.ProxyType)
} }
if config.Path == "" { if config.Path == "" {