mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-26 19:03:16 +00:00
cleanup: Cleanup YAML passed to k8s module
Cleanup the YAML passed to the k8s module so it conforms to yaml output you would expect from yaml.dump. Also refactor the tests to get rid of duplicate definitions and make use of pytest.mark.parametrize and yaml.dump. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
@@ -265,12 +265,12 @@ apiVersion: {{ api_version }}
|
||||
kind: VirtualMachine
|
||||
metadata:
|
||||
{% if name %}
|
||||
name: "{{ name }}"
|
||||
name: {{ name }}
|
||||
{% endif %}
|
||||
{% if generate_name %}
|
||||
generateName: "{{ generate_name }}"
|
||||
generateName: {{ generate_name }}
|
||||
{% endif %}
|
||||
namespace: "{{ namespace }}"
|
||||
namespace: {{ namespace }}
|
||||
{% if annotations %}
|
||||
annotations:
|
||||
{{ annotations | to_yaml | indent(4) }}
|
||||
@@ -280,7 +280,7 @@ metadata:
|
||||
{{ labels | to_yaml | indent(4) }}
|
||||
{%- endif %}
|
||||
spec:
|
||||
running: {{ running }}
|
||||
running: {{ running | lower }}
|
||||
{% if instancetype %}
|
||||
instancetype:
|
||||
{{ instancetype | to_yaml | indent(4) }}
|
||||
@@ -291,7 +291,7 @@ spec:
|
||||
{%- endif %}
|
||||
{% if data_volume_templates %}
|
||||
dataVolumeTemplates:
|
||||
{{ data_volume_templates | to_yaml | indent(4) }}
|
||||
{{ data_volume_templates | to_yaml | indent(2) }}
|
||||
{%- endif %}
|
||||
template:
|
||||
{% if annotations or labels %}
|
||||
|
||||
Reference in New Issue
Block a user