Fix vm update hook

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil
2025-09-01 14:33:42 +02:00
parent 33691c2d3a
commit 15b213b38b
2 changed files with 4 additions and 4 deletions

View File

@@ -64,14 +64,14 @@ spec:
- |
{{- if $needUpdateType }}
echo "Patching VirtualMachine for instancetype update..."
kubectl patch virtualmachine {{ $vmName }} -n {{ $namespace }} \
kubectl patch virtualmachines.kubevirt.io {{ $vmName }} -n {{ $namespace }} \
--type merge \
-p '{"spec":{"instancetype":{"name": "{{ $instanceType }}", "revisionName": null}}}'
{{- end }}
{{- if $needUpdateProfile }}
echo "Patching VirtualMachine for preference update..."
kubectl patch virtualmachine {{ $vmName }} -n {{ $namespace }} \
kubectl patch virtualmachines.kubevirt.io {{ $vmName }} -n {{ $namespace }} \
--type merge \
-p '{"spec":{"preference":{"name": "{{ $instanceProfile }}", "revisionName": null}}}'
{{- end }}

View File

@@ -54,14 +54,14 @@ spec:
- |
{{- if $needUpdateType }}
echo "Patching VirtualMachine for instancetype update..."
kubectl patch virtualmachine {{ $vmName }} -n {{ $namespace }} \
kubectl patch virtualmachines.kubevirt.io {{ $vmName }} -n {{ $namespace }} \
--type merge \
-p '{"spec":{"instancetype":{"name": "{{ $instanceType }}", "revisionName": null}}}'
{{- end }}
{{- if $needUpdateProfile }}
echo "Patching VirtualMachine for preference update..."
kubectl patch virtualmachine {{ $vmName }} -n {{ $namespace }} \
kubectl patch virtualmachines.kubevirt.io {{ $vmName }} -n {{ $namespace }} \
--type merge \
-p '{"spec":{"preference":{"name": "{{ $instanceProfile }}", "revisionName": null}}}'
{{- end }}