Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
cli: fix build
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bergwolf committed Sep 11, 2018
1 parent 52394c3 commit 1325444
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions cli/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1325444

Please sign in to comment.