diff --git a/images/virtualization-artifact/pkg/controller/kvbuilder/kvvm.go b/images/virtualization-artifact/pkg/controller/kvbuilder/kvvm.go index 58046f790a..cf356660ee 100644 --- a/images/virtualization-artifact/pkg/controller/kvbuilder/kvvm.go +++ b/images/virtualization-artifact/pkg/controller/kvbuilder/kvvm.go @@ -582,3 +582,18 @@ func (b *KVVM) GetBootloaderSettings() map[string]interface{} { }, } } + +func (b *KVVM) SetMetadata(metadata metav1.ObjectMeta) { + if b.ResourceExists { + // initialize only + return + } + if b.Resource.Spec.Template.ObjectMeta.Labels == nil { + b.Resource.Spec.Template.ObjectMeta.Labels = make(map[string]string, len(metadata.Labels)) + } + if b.Resource.Spec.Template.ObjectMeta.Annotations == nil { + b.Resource.Spec.Template.ObjectMeta.Annotations = make(map[string]string, len(metadata.Annotations)) + } + maps.Copy(b.Resource.Spec.Template.ObjectMeta.Labels, metadata.Labels) + maps.Copy(b.Resource.Spec.Template.ObjectMeta.Annotations, metadata.Annotations) +} diff --git a/images/virtualization-artifact/pkg/controller/kvbuilder/kvvm_utils.go b/images/virtualization-artifact/pkg/controller/kvbuilder/kvvm_utils.go index 9f2ed0aef0..be1d8d8afa 100644 --- a/images/virtualization-artifact/pkg/controller/kvbuilder/kvvm_utils.go +++ b/images/virtualization-artifact/pkg/controller/kvbuilder/kvvm_utils.go @@ -89,6 +89,7 @@ func ApplyVirtualMachineSpec( return err } + kvvm.SetMetadata(vm.ObjectMeta) kvvm.SetNetworkInterface(NetworkInterfaceName) kvvm.SetTablet("default-0") kvvm.SetNodeSelector(vm.Spec.NodeSelector, class.Spec.NodeSelector.MatchLabels) diff --git a/tests/e2e/Taskfile.yaml b/tests/e2e/Taskfile.yaml index 0f3cf275e1..7159172bbb 100644 --- a/tests/e2e/Taskfile.yaml +++ b/tests/e2e/Taskfile.yaml @@ -55,7 +55,6 @@ tasks: cmds: - | RESULT=$(ginkgo \ - --skip-file affinity_toleration_test.go \ --no-color \ -v | tee /dev/stderr | grep --color=never -E 'FAIL!|SUCCESS!') if [ "${PIPESTATUS[0]}" -ne "0" ]; then @@ -106,7 +105,6 @@ tasks: cmds: - | ginkgo -v \ - --skip-file affinity_toleration_test.go \ {{if .FOCUS -}} --focus "{{ .FOCUS }}" {{end}}