From 13254440c641613cb972b582f7d207bff54ba25b Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Tue, 11 Sep 2018 09:41:30 +0800 Subject: [PATCH] cli: fix build Sadly CI failed to catch the broken line due to the fact that it is introduced by a different PR that passed w/o the naming PR. ./config.go:604:27: config.DefaultMemSz undefined (type virtcontainers.HypervisorConfig has no field or method DefaultMemSz) Makefile:331: recipe for target '/golang/src/github.com/kata-containers/runtime/kata-runtime' failed make: *** [/golang/src/github.com/kata-containers/runtime/kata-runtime] Error 2 Fixes: #709 Signed-off-by: Peng Tao --- cli/config.go | 2 +- cli/config_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/config.go b/cli/config.go index 039eb14c94..ae4432c9dd 100644 --- a/cli/config.go +++ b/cli/config.go @@ -601,7 +601,7 @@ func checkHypervisorConfig(config vc.HypervisorConfig) error { }, } - memSizeMB := int64(config.DefaultMemSz) + memSizeMB := int64(config.MemorySize) if memSizeMB == 0 { return errors.New("VM memory cannot be zero") diff --git a/cli/config_test.go b/cli/config_test.go index a1f50e85de..4b3a6ef4fb 100644 --- a/cli/config_test.go +++ b/cli/config_test.go @@ -476,7 +476,7 @@ func TestMinimalRuntimeConfig(t *testing.T) { imagePath := path.Join(dir, "image.img") initrdPath := path.Join(dir, "initrd.img") - hypervisorPath := path.Join(dir, "hypervisor") + hypervisorPath = path.Join(dir, "hypervisor") kernelPath := path.Join(dir, "kernel") savedDefaultImagePath := defaultImagePath @@ -1389,9 +1389,9 @@ func TestCheckHypervisorConfig(t *testing.T) { kataLog.Logger.Out = logBuf config := vc.HypervisorConfig{ - ImagePath: d.imagePath, - InitrdPath: d.initrdPath, - DefaultMemSz: d.memBytes, + ImagePath: d.imagePath, + InitrdPath: d.initrdPath, + MemorySize: d.memBytes, } err := checkHypervisorConfig(config)