NAS-121481 / 23.10 / Set nvidia caps to void when no gpu is passed, also adds render group when a gpu is selected and other small fixes (#1124)

* Set nvidia caps to void when no gpu is passed

* add tests to init containers too

* Additionally add `render` group when gpu is added

* Correctly handle "0" gpu

* handle fsGroup 0 properly

* fix gh highlight

* Correct nvidia variable and add additional check for runtime

* cast both sides of the comparison

* fix externalinterfaces nesting

* Add dnsConfig missing docs
This commit is contained in:
Stavros Kois
2023-04-20 01:27:23 +03:00
committed by GitHub
parent bebaa5040f
commit 63326effb3
17 changed files with 408 additions and 100 deletions

View File

@@ -28,23 +28,23 @@ objectData: The object data to validate that contains the external interface con
{{- fail (printf "External Interface - Expected <ipam.type> to be one of [%s], but got [%s]" (join ", " $types) $objectData.ipam.type) -}}
{{- end -}}
{{- if and (or $objectData.staticIPConfigurations $objectData.staticRoutes) (ne $objectData.ipam.type "static") -}}
{{- fail "External Interface - Expected empty <staticIPConfigurations> and <staticRoutes> when <ipam.type> is not [static]" -}}
{{- if and (or $objectData.ipam.staticIPConfigurations $objectData.ipam.staticRoutes) (ne $objectData.ipam.type "static") -}}
{{- fail "External Interface - Expected empty <ipam.staticIPConfigurations> and <ipam.staticRoutes> when <ipam.type> is not [static]" -}}
{{- end -}}
{{- if eq $objectData.ipam.type "static" -}}
{{- if not $objectData.staticIPConfigurations -}}
{{- fail "External Interface - Expected non-empty <staticIPConfigurations> when <ipam.type> is [static]" -}}
{{- if not $objectData.ipam.staticIPConfigurations -}}
{{- fail "External Interface - Expected non-empty <ipam.staticIPConfigurations> when <ipam.type> is [static]" -}}
{{- end -}}
{{- with $objectData.staticRoutes -}}
{{- with $objectData.ipam.staticRoutes -}}
{{- range . -}}
{{- if not .destination -}}
{{- fail "External Interface - Expected non-empty <destination> in <staticRoutes>" -}}
{{- fail "External Interface - Expected non-empty <destination> in <ipam.staticRoutes>" -}}
{{- end -}}
{{- if not .gateway -}}
{{- fail "External Interface - Expected non-empty <gateway> in <staticRoutes>" -}}
{{- fail "External Interface - Expected non-empty <gateway> in <ipam.staticRoutes>" -}}
{{- end -}}
{{- end -}}
{{- end -}}