vmi_cloudinit_hook_sidecar_test: use libvmi.NewCirros to define vmi
@@ -37,8 +37,8 @@ import (
"kubevirt.io/kubevirt/tests"
"kubevirt.io/kubevirt/tests/console"
- cd "kubevirt.io/kubevirt/tests/containerdisk"
"kubevirt.io/kubevirt/tests/flags"
+ "kubevirt.io/kubevirt/tests/libvmi"
)
const cloudinitHookSidecarImage = "example-cloudinit-hook-sidecar"
@@ -93,10 +93,9 @@ var _ = Describe("[sig-compute]CloudInitHookSidecars", func() {
BeforeEach(func() {
virtClient, err = kubecli.GetKubevirtClient()
util.PanicOnError(err)
- vmi = tests.NewRandomVMIWithEphemeralDiskAndUserdata(cd.ContainerDiskFor(cd.ContainerDiskCirros), "#FAKE")
- vmi.ObjectMeta.Annotations = map[string]string{
- "hooks.kubevirt.io/hookSidecars": fmt.Sprintf(`[{"image": "%s/%s:%s", "imagePullPolicy": "IfNotPresent"}]`, flags.KubeVirtUtilityRepoPrefix, cloudinitHookSidecarImage, flags.KubeVirtUtilityVersionTag),
- }
+ vmi = libvmi.NewCirros(
+ libvmi.WithAnnotation("hooks.kubevirt.io/hookSidecars",
+ fmt.Sprintf(`[{"image": "%s/%s:%s", "imagePullPolicy": "IfNotPresent"}]`, flags.KubeVirtUtilityRepoPrefix, cloudinitHookSidecarImage, flags.KubeVirtUtilityVersionTag)))
})
Describe("VMI definition", func() {
