From 3eda3f122859bc5ce8e95b1d279addc742727161 Mon Sep 17 00:00:00 2001 From: Jonas Wielage Date: Thu, 5 Dec 2024 17:33:34 +0100 Subject: [PATCH] Modify rule S117: Add exception to kubernetes language --- rules/S117/kubernetes/rule.adoc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/rules/S117/kubernetes/rule.adoc b/rules/S117/kubernetes/rule.adoc index ef29d9a8dbe..4e8ae2db268 100644 --- a/rules/S117/kubernetes/rule.adoc +++ b/rules/S117/kubernetes/rule.adoc @@ -2,12 +2,24 @@ :identifier: local variable and function parameter :identifier_plural: local variables and function parameters :identifier_or: local variable or function parameter -:regex: ^[a-z][a-zA-Z0-9]*$ +:regex: ^\$[a-z][a-zA-Z0-9]*$ -include::../rule.adoc[] + +include::../introduction.adoc[] + +include::../why-is-this-an-issue.adoc[] + +=== Exceptions + +The rule does not raise an issue on the usages of the blank identifier `$_` or the root context `$`. + +include::../what-is-the-potential-impact.adoc[] + +include::../how-to-fix-it.adoc[] As a default, we suggest using the camelCase naming convention, as this is widely adopted for variables in Helm. + === Code examples ==== Noncompliant code example @@ -51,6 +63,11 @@ data: {{ $keyC }}: {{ $valC | quote }} {{- end }} ---- + +[source,text] +---- +{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className -}} +---- == Resources === Documentation