File tree Expand file tree Collapse file tree
packages/apps/vm-instance Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,12 +35,14 @@ spec:
3535 metadata :
3636 annotations :
3737 kubevirt.io/allow-pod-bridge-network-live-migration : " true"
38+ {{- if .Capabilities.APIVersions.Has "kubeovn.io/v1/IP" }}
3839 {{- $ovnIPName := printf "%s.%s" (include "virtual-machine.fullname" .) .Release.Namespace }}
3940 {{- $ovnIP := lookup "kubeovn.io/v1" "IP" "" $ovnIPName }}
4041 {{- if $ovnIP }}
4142 ovn.kubernetes.io/mac_address : {{ $ovnIP.spec.macAddress | quote }}
4243 ovn.kubernetes.io/ip_address : {{ $ovnIP.spec.ipAddress | quote }}
4344 {{- end }}
45+ {{- end }}
4446 labels :
4547 {{- include "virtual-machine.labels" . | nindent 8 }}
4648 spec :
Original file line number Diff line number Diff line change 1+ suite : vm-instance supports clusters without Kube-OVN
2+
3+ release :
4+ name : test-vm
5+ namespace : tenant-test
6+ templates :
7+ - templates/vm.yaml
8+ capabilities :
9+ apiVersions : []
10+ set :
11+ fullnameOverride : test-vm
12+ instanceType : " "
13+ instanceProfile : " "
14+ resources :
15+ cpu : 1
16+ sockets : 1
17+ memory : 1Gi
18+ _cluster :
19+ scheduling :
20+ dedicatedNodesForWindowsVMs : " false"
21+ tests :
22+ - it : renders a VirtualMachine without Kube-OVN annotations
23+ asserts :
24+ - isKind :
25+ of : VirtualMachine
26+ - notExists :
27+ path : spec.template.metadata.annotations["ovn.kubernetes.io/mac_address"]
28+ - notExists :
29+ path : spec.template.metadata.annotations["ovn.kubernetes.io/ip_address"]
You can’t perform that action at this time.
0 commit comments