[Backport release-1.1] [platform] Fix VM MAC address not preserved during migration (#2190)

# Description
Backport of #2169 to `release-1.1`.
This commit is contained in:
Andrei Kvapil 2026-03-10 15:19:15 +01:00 committed by GitHub
commit 109b4a333e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,6 +34,12 @@ spec:
metadata:
annotations:
kubevirt.io/allow-pod-bridge-network-live-migration: "true"
{{- $ovnIPName := printf "%s.%s" (include "virtual-machine.fullname" .) .Release.Namespace }}
{{- $ovnIP := lookup "kubeovn.io/v1" "IP" "" $ovnIPName }}
{{- if $ovnIP }}
ovn.kubernetes.io/mac_address: {{ $ovnIP.spec.macAddress | quote }}
ovn.kubernetes.io/ip_address: {{ $ovnIP.spec.ipAddress | quote }}
{{- end }}
labels:
{{- include "virtual-machine.labels" . | nindent 8 }}
spec: