apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: {{.SriovNetworkName}}
  namespace: {{.SriovNetworkNamespace}}
  annotations:
    k8s.v1.cni.cncf.io/resourceName: {{.SriovCniResourceName}}
spec:
  config: '{
  "cniVersion":"0.3.1",
  "name":"{{.SriovNetworkName}}",
  "type":"sriov",
  "vlan":{{.SriovCniVlan}},
{{- if .CapabilitiesConfigured -}}
  "capabilities":{{.SriovCniCapabilities}},
{{- end -}}
{{- if .SpoofChkConfigured -}}
  "spoofchk":"{{.SriovCniSpoofChk}}",
{{- end -}}
{{- if .TrustConfigured -}}
  "trust":"{{.SriovCniTrust}}",
{{- end -}}
{{- if .StateConfigured -}}
  "link_state":"{{.SriovCniState}}",
{{- end -}}
{{- if .VlanQoSConfigured -}}
  "vlanQoS":{{.SriovCniVlanQoS}},
{{- end -}}
{{- if .MinTxRateConfigured -}}
  "min_tx_rate":{{.SriovCniMinTxRate}},
{{- end -}}
{{- if .MaxTxRateConfigured -}}
  "max_tx_rate":{{.SriovCniMaxTxRate}},
{{- end -}}
  {{.SriovCniIpam}}
}'
