From 1fb391500338691a2beb62ff7cb2f372553abb49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Wed, 2 Nov 2022 15:47:46 +0100 Subject: [PATCH 1/3] Disable linting of tempalte yaml files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index 72cd4a39eb..844a94da14 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -34,7 +34,7 @@ SHOW_ELAPSED_TIME: true DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass # ignore files generated by controller-gen -FILTER_REGEX_EXCLUDE: (.*rbac/role\.yaml|.*bases/.*\.yaml) +FILTER_REGEX_EXCLUDE: (.*rbac/role\.yaml|.*bases/.*\.yaml|.*/templates/.*\yaml) VALIDATE_ALL_CODEBASE: false IGNORE_GENERATED_FILES: true From 87058c95733d49d332453c9bbaa416f3a304d19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Wed, 2 Nov 2022 15:48:29 +0100 Subject: [PATCH 2/3] Fix megalint autofix changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- demo-targets/bodgeit/templates/service.yaml | 9 ++++++--- demo-targets/dummy-ssh/templates/service.yaml | 9 ++++++--- demo-targets/http-webhook/templates/service.yaml | 9 ++++++--- demo-targets/juice-shop/templates/service.yaml | 9 ++++++--- demo-targets/old-joomla/templates/service.yaml | 6 ++++-- demo-targets/old-typo3/templates/service.yaml | 6 ++++-- demo-targets/old-wordpress/templates/service.yaml | 9 ++++++--- demo-targets/swagger-petstore/templates/service.yaml | 9 ++++++--- demo-targets/unsafe-https/templates/service.yaml | 9 ++++++--- demo-targets/vulnerable-log4j/templates/service.yaml | 9 ++++++--- hooks/notification/templates/configmap.yaml | 3 ++- operator/config/rbac/role.yaml | 1 - 12 files changed, 58 insertions(+), 30 deletions(-) diff --git a/demo-targets/bodgeit/templates/service.yaml b/demo-targets/bodgeit/templates/service.yaml index f324296e48..715824008d 100644 --- a/demo-targets/bodgeit/templates/service.yaml +++ b/demo-targets/bodgeit/templates/service.yaml @@ -6,8 +6,10 @@ apiVersion: v1 kind: Service metadata: name: {{include "bodgeit.fullname" .}} - labels: {{- include "bodgeit.labels" . | nindent 4}} - annotations: {{- include "bodgeit.annotations" . | nindent 4}} + labels: + {{- include "bodgeit.labels" . | nindent 4}} + annotations: + {{- include "bodgeit.annotations" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -15,4 +17,5 @@ spec: targetPort: http protocol: TCP name: http - selector: {{- include "bodgeit.selectorLabels" . | nindent 4}} + selector: + {{- include "bodgeit.selectorLabels" . | nindent 4}} diff --git a/demo-targets/dummy-ssh/templates/service.yaml b/demo-targets/dummy-ssh/templates/service.yaml index 32bfe65659..81d9bdb15c 100644 --- a/demo-targets/dummy-ssh/templates/service.yaml +++ b/demo-targets/dummy-ssh/templates/service.yaml @@ -6,8 +6,10 @@ apiVersion: v1 kind: Service metadata: name: {{include "dummy-ssh.fullname" .}} - labels: {{- include "dummy-ssh.labels" . | nindent 4}} - annotations: {{- include "dummy-ssh.annotations" . | nindent 4}} + labels: + {{- include "dummy-ssh.labels" . | nindent 4}} + annotations: + {{- include "dummy-ssh.annotations" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -15,4 +17,5 @@ spec: targetPort: ssh protocol: TCP name: ssh - selector: {{- include "dummy-ssh.selectorLabels" . | nindent 4}} + selector: + {{- include "dummy-ssh.selectorLabels" . | nindent 4}} diff --git a/demo-targets/http-webhook/templates/service.yaml b/demo-targets/http-webhook/templates/service.yaml index 0879e17167..a0d1af5dbe 100644 --- a/demo-targets/http-webhook/templates/service.yaml +++ b/demo-targets/http-webhook/templates/service.yaml @@ -6,8 +6,10 @@ apiVersion: v1 kind: Service metadata: name: {{include "http-webhook.fullname" .}} - labels: {{- include "http-webhook.labels" . | nindent 4}} - annotations: {{- include "http-webhook.annotations" . | nindent 4}} + labels: + {{- include "http-webhook.labels" . | nindent 4}} + annotations: + {{- include "http-webhook.annotations" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -15,4 +17,5 @@ spec: targetPort: http protocol: TCP name: http - selector: {{- include "http-webhook.selectorLabels" . | nindent 4}} + selector: + {{- include "http-webhook.selectorLabels" . | nindent 4}} diff --git a/demo-targets/juice-shop/templates/service.yaml b/demo-targets/juice-shop/templates/service.yaml index ba3253ce67..b408601243 100644 --- a/demo-targets/juice-shop/templates/service.yaml +++ b/demo-targets/juice-shop/templates/service.yaml @@ -6,8 +6,10 @@ apiVersion: v1 kind: Service metadata: name: {{include "juice-shop.fullname" .}} - labels: {{- include "juice-shop.labels" . | nindent 4}} - annotations: {{- include "juice-shop.annotations" . | nindent 4}} + labels: + {{- include "juice-shop.labels" . | nindent 4}} + annotations: + {{- include "juice-shop.annotations" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -15,4 +17,5 @@ spec: targetPort: http protocol: TCP name: http - selector: {{- include "juice-shop.selectorLabels" . | nindent 4}} + selector: + {{- include "juice-shop.selectorLabels" . | nindent 4}} diff --git a/demo-targets/old-joomla/templates/service.yaml b/demo-targets/old-joomla/templates/service.yaml index 3c62ebe285..5a6d7e731c 100644 --- a/demo-targets/old-joomla/templates/service.yaml +++ b/demo-targets/old-joomla/templates/service.yaml @@ -2,7 +2,8 @@ apiVersion: v1 kind: Service metadata: name: {{include "old-joomla.fullname" .}} - labels: {{- include "old-joomla.labels" . | nindent 4}} + labels: + {{- include "old-joomla.labels" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -10,4 +11,5 @@ spec: targetPort: http protocol: TCP name: http - selector: {{- include "old-joomla.selectorLabels" . | nindent 4}} + selector: + {{- include "old-joomla.selectorLabels" . | nindent 4}} diff --git a/demo-targets/old-typo3/templates/service.yaml b/demo-targets/old-typo3/templates/service.yaml index 5f4cd9e7f8..da41b8023b 100644 --- a/demo-targets/old-typo3/templates/service.yaml +++ b/demo-targets/old-typo3/templates/service.yaml @@ -2,7 +2,8 @@ apiVersion: v1 kind: Service metadata: name: {{include "old-typo3.fullname" .}} - labels: {{- include "old-typo3.labels" . | nindent 4}} + labels: + {{- include "old-typo3.labels" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -10,4 +11,5 @@ spec: targetPort: http protocol: TCP name: http - selector: {{- include "old-typo3.selectorLabels" . | nindent 4}} + selector: + {{- include "old-typo3.selectorLabels" . | nindent 4}} diff --git a/demo-targets/old-wordpress/templates/service.yaml b/demo-targets/old-wordpress/templates/service.yaml index 18316bf45c..1be29edb4a 100644 --- a/demo-targets/old-wordpress/templates/service.yaml +++ b/demo-targets/old-wordpress/templates/service.yaml @@ -6,8 +6,10 @@ apiVersion: v1 kind: Service metadata: name: {{include "old-wordpress.fullname" .}} - labels: {{- include "old-wordpress.labels" . | nindent 4}} - annotations: {{- include "old-wordpress.annotations" . | nindent 4}} + labels: + {{- include "old-wordpress.labels" . | nindent 4}} + annotations: + {{- include "old-wordpress.annotations" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -15,4 +17,5 @@ spec: targetPort: http protocol: TCP name: http - selector: {{- include "old-wordpress.selectorLabels" . | nindent 4}} + selector: + {{- include "old-wordpress.selectorLabels" . | nindent 4}} diff --git a/demo-targets/swagger-petstore/templates/service.yaml b/demo-targets/swagger-petstore/templates/service.yaml index 357fb24c69..05c2fc7da2 100644 --- a/demo-targets/swagger-petstore/templates/service.yaml +++ b/demo-targets/swagger-petstore/templates/service.yaml @@ -6,8 +6,10 @@ apiVersion: v1 kind: Service metadata: name: {{include "swagger-petstore.fullname" .}} - labels: {{- include "swagger-petstore.labels" . | nindent 4}} - annotations: {{- include "swagger-petstore.annotations" . | nindent 4}} + labels: + {{- include "swagger-petstore.labels" . | nindent 4}} + annotations: + {{- include "swagger-petstore.annotations" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -15,4 +17,5 @@ spec: targetPort: http protocol: TCP name: http - selector: {{- include "swagger-petstore.selectorLabels" . | nindent 4}} + selector: + {{- include "swagger-petstore.selectorLabels" . | nindent 4}} diff --git a/demo-targets/unsafe-https/templates/service.yaml b/demo-targets/unsafe-https/templates/service.yaml index 9cac392cce..eae2db080e 100644 --- a/demo-targets/unsafe-https/templates/service.yaml +++ b/demo-targets/unsafe-https/templates/service.yaml @@ -6,8 +6,10 @@ apiVersion: v1 kind: Service metadata: name: {{include "unsafe-https.fullname" .}} - labels: {{- include "unsafe-https.labels" . | nindent 4}} - annotations: {{- include "unsafe-https.annotations" . | nindent 4}} + labels: + {{- include "unsafe-https.labels" . | nindent 4}} + annotations: + {{- include "unsafe-https.annotations" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -15,4 +17,5 @@ spec: targetPort: https protocol: TCP name: https - selector: {{- include "unsafe-https.selectorLabels" . | nindent 4}} + selector: + {{- include "unsafe-https.selectorLabels" . | nindent 4}} diff --git a/demo-targets/vulnerable-log4j/templates/service.yaml b/demo-targets/vulnerable-log4j/templates/service.yaml index fa2fd7fff2..f3858c4144 100644 --- a/demo-targets/vulnerable-log4j/templates/service.yaml +++ b/demo-targets/vulnerable-log4j/templates/service.yaml @@ -6,8 +6,10 @@ apiVersion: v1 kind: Service metadata: name: {{include "vulnerable-log4j.fullname" .}} - labels: {{- include "vulnerable-log4j.labels" . | nindent 4}} - annotations: {{- include "vulnerable-log4j.annotations" . | nindent 4}} + labels: + {{- include "vulnerable-log4j.labels" . | nindent 4}} + annotations: + {{- include "vulnerable-log4j.annotations" . | nindent 4}} spec: type: {{.Values.service.type}} ports: @@ -15,4 +17,5 @@ spec: targetPort: http protocol: TCP name: http - selector: {{- include "vulnerable-log4j.selectorLabels" . | nindent 4}} + selector: + {{- include "vulnerable-log4j.selectorLabels" . | nindent 4}} diff --git a/hooks/notification/templates/configmap.yaml b/hooks/notification/templates/configmap.yaml index a7ca7fcd7b..9c3c4a3913 100644 --- a/hooks/notification/templates/configmap.yaml +++ b/hooks/notification/templates/configmap.yaml @@ -7,7 +7,8 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Release.Name }}-config" - labels: {{- include "notification-hook.labels" . | nindent 4}} + labels: + {{- include "notification-hook.labels" . | nindent 4}} data: notification-channel.yaml: | {{ .Values.notificationChannels | toYaml | nindent 4 }} diff --git a/operator/config/rbac/role.yaml b/operator/config/rbac/role.yaml index 164b407091..661d011ab0 100644 --- a/operator/config/rbac/role.yaml +++ b/operator/config/rbac/role.yaml @@ -1,4 +1,3 @@ - --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole From f0e5614fc9f9bdccec998441d24eb650584bc7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BClkenberg?= Date: Wed, 2 Nov 2022 16:12:47 +0100 Subject: [PATCH 3/3] Fix megalinter config regex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Hülkenberg --- .mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index 844a94da14..87c7d9aa7d 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -34,7 +34,7 @@ SHOW_ELAPSED_TIME: true DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass # ignore files generated by controller-gen -FILTER_REGEX_EXCLUDE: (.*rbac/role\.yaml|.*bases/.*\.yaml|.*/templates/.*\yaml) +FILTER_REGEX_EXCLUDE: (.*rbac/role\.yaml|.*bases/.*\.yaml|.*/templates/.*\.yaml) VALIDATE_ALL_CODEBASE: false IGNORE_GENERATED_FILES: true