Skip to content

Commit

Permalink
test: set kubevirt.io/memfd = false for k8s 1.16
Browse files Browse the repository at this point in the history
The provider for k8s 1.16 has an old version of libvirt that doesn't support
memfd. See:
   https://libvirt.org/formatdomain.html#memory-backing

Set the annotation kubevirt.io/memfd = false

Signed-off-by: Alice Frosi <[email protected]>
  • Loading branch information
alicefr committed Sep 8, 2020
1 parent 66c2ddb commit 70e8134
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/vmi_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
"strings"
"time"

"kubevirt.io/kubevirt/pkg/util/cluster"

expect "github.com/google/goexpect"
. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/extensions/table"
Expand Down Expand Up @@ -974,6 +976,14 @@ var _ = Describe("Configurations", func() {

table.DescribeTable("should consume hugepages ", func(hugepageSize string, memory string, guestMemory string) {
hugepageType := kubev1.ResourceName(kubev1.ResourceHugePagesPrefix + hugepageSize)
v, err := cluster.GetKubernetesVersion(virtClient)
Expect(err).ShouldNot(HaveOccurred())
if strings.Contains(v, "1.16") {
hugepagesVmi.Annotations = map[string]string{
v1.MemfdMemoryBackend: "false",
}
log.DefaultLogger().Object(hugepagesVmi).Infof("Fall back to use hugepages source file. Libvirt in the 1.16 provider version doesn't support memfd as memory backend")
}

nodeWithHugepages := tests.GetNodeWithHugepages(virtClient, hugepageType)
if nodeWithHugepages == nil {
Expand Down

0 comments on commit 70e8134

Please sign in to comment.