Skip to content

Commit

Permalink
Propogate network binding plugin to kubevirt CR
Browse files Browse the repository at this point in the history
Signed-off-by: Alona Paz <[email protected]>
  • Loading branch information
AlonaKaplan committed Nov 12, 2023
1 parent 4c519f8 commit 208998a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions controllers/operands/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ func getKVConfig(hc *hcov1beta1.HyperConverged) (*kubevirtcorev1.KubeVirtConfigu
DeveloperConfiguration: devConfig,
NetworkConfiguration: &kubevirtcorev1.NetworkConfiguration{
NetworkInterface: string(kubevirtcorev1.MasqueradeInterface),
Binding: hc.Spec.NetworkBinding,
},
MigrationConfiguration: kvLiveMigration,
PermittedHostDevices: toKvPermittedHostDevices(hc.Spec.PermittedHostDevices),
Expand Down
5 changes: 5 additions & 0 deletions controllers/operands/kubevirt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ Version: 1.2.3`)
hco.Spec.FeatureGates = hcov1beta1.HyperConvergedFeatureGates{
WithHostPassthroughCPU: ptr.To(true),
}
bindingPlugins := map[string]kubevirtcorev1.InterfaceBindingPlugin{
"binding1": {SidecarImage: "image1", NetworkAttachmentDefinition: "nad1"},
}
hco.Spec.NetworkBinding = bindingPlugins

expectedResource, err := NewKubeVirt(hco, commontestutils.Namespace)
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -240,6 +244,7 @@ Version: 1.2.3`)

Expect(foundResource.Spec.Configuration.NetworkConfiguration).ToNot(BeNil())
Expect(foundResource.Spec.Configuration.NetworkConfiguration.NetworkInterface).Should(Equal(string(kubevirtcorev1.MasqueradeInterface)))
Expect(foundResource.Spec.Configuration.NetworkConfiguration.Binding).Should(Equal(bindingPlugins))

// LiveMigration Configurations
mc := foundResource.Spec.Configuration.MigrationConfiguration
Expand Down

0 comments on commit 208998a

Please sign in to comment.