Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDN: Patch Kubevirt CR to support managedTap binding #4773

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions contrib/kind-common
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,7 @@ install_kubevirt() {
fi

kubectl -n kubevirt patch kubevirt kubevirt --type=json --patch '[{"op":"add","path":"/spec/configuration/developerConfiguration","value":{"featureGates":[]}},{"op":"add","path":"/spec/configuration/developerConfiguration/featureGates/-","value":"NetworkBindingPlugins"}]'

local passt_binding_image="quay.io/kubevirt/network-passt-binding:${kubevirt_version}"
kubectl -n kubevirt patch kubevirt kubevirt --type=json --patch '[{"op":"add","path":"/spec/configuration/network","value":{}},{"op":"add","path":"/spec/configuration/network/binding","value":{"passt":{"computeResourceOverhead":{"requests":{"memory":"500Mi"}},"migration":{"method":"link-refresh"},"networkAttachmentDefinition":"default/primary-udn-kubevirt-binding","sidecarImage":"'"${passt_binding_image}"'"}}}]'
kubectl -n kubevirt patch kubevirt kubevirt --type=json --patch '[{"op":"add","path":"/spec/configuration/network","value":{"binding":{"managedTap":{"domainAttachmentType":"managedTap","migration":{}}}}}]'

if [ ! -d "./bin" ]
then
Expand Down
16 changes: 4 additions & 12 deletions test/e2e/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ passwd:
}, butane)
Expect(err).ToNot(HaveOccurred())
vm.Spec.Template.Spec.Domain.Devices.Interfaces[0].Bridge = nil
vm.Spec.Template.Spec.Domain.Devices.Interfaces[0].Binding = &kubevirtv1.PluginBinding{Name: "passt"}
vm.Spec.Template.Spec.Domain.Devices.Interfaces[0].Binding = &kubevirtv1.PluginBinding{Name: "managedTap"}
createVirtualMachine(vm)
return vm.Name
},
Expand Down Expand Up @@ -1226,7 +1226,7 @@ passwd:
}, butane)
Expect(err).ToNot(HaveOccurred())
vmi.Spec.Domain.Devices.Interfaces[0].Bridge = nil
vmi.Spec.Domain.Devices.Interfaces[0].Binding = &kubevirtv1.PluginBinding{Name: "passt"}
vmi.Spec.Domain.Devices.Interfaces[0].Binding = &kubevirtv1.PluginBinding{Name: "managedTap"}
createVirtualMachineInstance(vmi)
return vmi.Name
},
Expand Down Expand Up @@ -1311,11 +1311,7 @@ passwd:

step := by(vmi.Name, "Login to virtual machine for the first time")
Eventually(func() error {
if td.role != "primary" {
return kubevirt.LoginToFedora(vmi, "core", "fedora")
} else {
return kubevirt.LoginToFedoraWithHostname(vmi, "core", "fedora", "localhost")
}
return kubevirt.LoginToFedora(vmi, "core", "fedora")
}).
WithTimeout(5*time.Second).
WithPolling(time.Second).
Expand Down Expand Up @@ -1344,11 +1340,7 @@ passwd:
td.test.cmd()

step = by(vm.Name, fmt.Sprintf("Login to virtual machine after %s %s", td.resource.description, td.test.description))
if td.role != "primary" {
Expect(kubevirt.LoginToFedora(vmi, "core", "fedora")).To(Succeed(), step)
} else {
Expect(kubevirt.LoginToFedoraWithHostname(vmi, "core", "fedora", "localhost")).To(Succeed(), step)
}
Expect(kubevirt.LoginToFedora(vmi, "core", "fedora")).To(Succeed(), step)
var obtainedAddresses []string

if td.role != "primary" { // expect 2 addresses on dual-stack deployments; 1 on single-stack
Expand Down
Loading