mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 07:29:21 -03:00
fix(resources): do not render zero-ed extra resources
This commit is contained in:
@@ -70,6 +70,7 @@ tests:
|
||||
nvidia.com/gpu: 1
|
||||
some-resource: 1
|
||||
some-other-resource: 0
|
||||
some-string-resource: "0"
|
||||
asserts:
|
||||
- documentIndex: &deploymentDoc 0
|
||||
isKind:
|
||||
@@ -87,7 +88,6 @@ tests:
|
||||
memory: 4Gi
|
||||
nvidia.com/gpu: 1
|
||||
some-resource: 1
|
||||
some-other-resource: 0
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 50Mi
|
||||
@@ -132,7 +132,6 @@ tests:
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 4Gi
|
||||
some-resource: 0
|
||||
some-other-resource: 2
|
||||
requests:
|
||||
cpu: 10m
|
||||
|
||||
@@ -15,7 +15,7 @@ maintainers:
|
||||
name: common
|
||||
sources: null
|
||||
type: library
|
||||
version: 20.2.4
|
||||
version: 20.2.5
|
||||
annotations:
|
||||
artifacthub.io/category: "integration-delivery"
|
||||
artifacthub.io/license: "BUSL-1.1"
|
||||
|
||||
@@ -37,6 +37,9 @@ limits:
|
||||
{{- end -}}
|
||||
{{- if not $objectData.resources.excludeExtra -}}
|
||||
{{- range $k, $v := (omit $resources.limits "cpu" "memory") }} {{/* Omit cpu and memory, as they are handled above */}}
|
||||
{{- if or (not $v) (eq (toString $v) "0") -}}
|
||||
{{ continue }}
|
||||
{{- end }}
|
||||
{{ $k }}: {{ $v }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user