apiVersion: core.eda.nokia.com/v1
kind: TopoNode
metadata:
  name: {{ name }}
  namespace: {{ namespace }}
{% if labels is defined and labels %}
  labels:
{% for k, v in labels.items() %}
    {{ k }}: {{ v | default('') }}
{% endfor %}
{% endif %}
spec:
  nodeProfile: {{ nodeProfile }}
  operatingSystem: {{ operatingSystem }}
  platform: {{ platform }}
  version: {{ version }}
{% if component is defined and component %}
  component:
{% for c in component %}
  - kind: {{ c.kind }}
    type: {{ c.type }}
{% if c.slot is defined and c.slot is not none %}
    slot: {{ c.slot }}
{% endif %}
{% endfor %}
{% endif %}
{% if license is defined and license is not none %}
  license: {{ license }}
{% endif %}
{% if macAddress is defined and macAddress is not none %}
  macAddress: {{ macAddress }}
{% endif %}
{% if npp is defined and npp %}
  npp:
{% if npp.mode is defined and npp.mode is not none %}
    mode: {{ npp.mode }}
{% endif %}
{% endif %}
{% if onBoarded is defined and onBoarded is not none %}
  onBoarded: {{ onBoarded }}
{% endif %}
{% if productionAddress is defined and productionAddress %}
  productionAddress:
{% if productionAddress.ipv4 is defined and productionAddress.ipv4 is not none %}
    ipv4: {{ productionAddress.ipv4 }}
{% endif %}
{% endif %}
{% if serialNumber is defined and serialNumber is not none %}
  serialNumber: {{ serialNumber }}
{% endif %}
{% if systemInterface is defined and systemInterface is not none %}
  systemInterface: {{ systemInterface }}
{% endif %}
