mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-26 19:03:16 +00:00
fix(kubevirt_vm): Allow switching between running and run_strategy
Allow switching between running and run_strategy by always clearing the other value. E.g. if run_strategy was provided then running set to None to clear it or vice versa. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
@@ -333,7 +333,9 @@ def create_vm(params: Dict) -> Dict:
|
||||
|
||||
if (run_strategy := params.get("run_strategy")) is not None:
|
||||
vm["spec"]["runStrategy"] = run_strategy
|
||||
vm["spec"]["running"] = None
|
||||
else:
|
||||
vm["spec"]["runStrategy"] = None
|
||||
vm["spec"]["running"] = (
|
||||
running if (running := params.get("running")) is not None else True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user