From 1803051f272c20303f363b77f68a7d4df61c079e Mon Sep 17 00:00:00 2001 From: Marco Mariani Date: Thu, 29 Dec 2022 16:41:23 +0100 Subject: [PATCH 1/3] add "ct lint" --- .github/workflows/lint-test.yaml | 3 +++ chart_schema.yaml | 38 ++++++++++++++++++++++++++++ lintconf.yaml | 43 ++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 chart_schema.yaml create mode 100644 lintconf.yaml diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 715c3351..d7c4bdc9 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -35,5 +35,8 @@ jobs: - name: Create kind cluster uses: helm/kind-action@v1.4.0 + - name: Run chart-testing (lint) + run: ct lint --charts ./charts/crowdsec + - name: Run chart-testing (install) run: ct install --charts ./charts/crowdsec diff --git a/chart_schema.yaml b/chart_schema.yaml new file mode 100644 index 00000000..5d5a1382 --- /dev/null +++ b/chart_schema.yaml @@ -0,0 +1,38 @@ +name: str() +home: str(required=False) +version: str() +apiVersion: str() +appVersion: any(str(), num(), required=False) +description: str(required=False) +keywords: list(str(), required=False) +sources: list(str(), required=False) +maintainers: list(include('maintainer'), required=False) +dependencies: list(include('dependency'), required=False) +icon: str(required=False) +engine: str(required=False) +condition: str(required=False) +tags: str(required=False) +deprecated: bool(required=False) +kubeVersion: str(required=False) +annotations: map(str(), str(), required=False) +type: str(required=False) +--- +maintainer: + name: str() + email: str(required=False) + url: str(required=False) +--- +dependency: + name: str() + version: str() + repository: str(required=False) + condition: str(required=False) + tags: list(str(), required=False) + enabled: bool(required=False) + import-values: any(list(str()), list(include('import-value')), required=False) + alias: str(required=False) +--- +import-value: + child: str() + parent: str() + diff --git a/lintconf.yaml b/lintconf.yaml new file mode 100644 index 00000000..3b7d46fc --- /dev/null +++ b/lintconf.yaml @@ -0,0 +1,43 @@ +--- +rules: + braces: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: + require-starting-space: true + min-spaces-from-content: 2 + document-end: disable + document-start: disable # No --- to start a file + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + hyphens: + max-spaces-after: 1 + indentation: + spaces: consistent + indent-sequences: whatever # - list indentation will handle both indentation and without + check-multi-line-strings: false + key-duplicates: enable + line-length: disable # Lines can be any length + new-line-at-end-of-file: enable + new-lines: + type: unix + trailing-spaces: enable + truthy: + level: warning + From ad53daf0e96d039597414b9c49bde7a7672a84d7 Mon Sep 17 00:00:00 2001 From: Marco Mariani Date: Thu, 29 Dec 2022 16:45:12 +0100 Subject: [PATCH 2/3] lint --- charts/crowdsec/values.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/charts/crowdsec/values.yaml b/charts/crowdsec/values.yaml index e949546c..1fc200e2 100644 --- a/charts/crowdsec/values.yaml +++ b/charts/crowdsec/values.yaml @@ -196,11 +196,11 @@ lapi: agent: acquisition: # -- Specify each pod you want to process it logs (namespace, podName and program) - - namespace: "" #ingress-nginx + - namespace: "" # ingress-nginx # -- to select pod logs to process - podName: "" #ingress-nginx-controller-* + podName: "" # ingress-nginx-controller-* # -- program name related to specific parser you will use (see https://hub.crowdsec.net/author/crowdsecurity/configurations/docker-logs) - program: "" #nginx + program: "" # nginx resources: limits: memory: 100Mi @@ -282,5 +282,4 @@ agent: # -- docker image tag tag: "1.28" -#service: {} - +# service: {} From 7d1af1bf9d257b98436209833147463caae061a6 Mon Sep 17 00:00:00 2001 From: Marco Mariani Date: Thu, 29 Dec 2022 16:47:22 +0100 Subject: [PATCH 3/3] lint --- charts/crowdsec/values.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/charts/crowdsec/values.yaml b/charts/crowdsec/values.yaml index 1fc200e2..074b5a2e 100644 --- a/charts/crowdsec/values.yaml +++ b/charts/crowdsec/values.yaml @@ -103,8 +103,8 @@ lapi: # -- environment variables from crowdsecurity/crowdsec docker image env: [] # by default disable the agent because it only needs the local API. - #- name: DISABLE_AGENT - # value: "true" + # - name: DISABLE_AGENT + # value: "true" # -- Enable ingress lapi object ingress: enabled: false @@ -112,8 +112,8 @@ lapi: # we only want http to the backend so we need this annotation nginx.ingress.kubernetes.io/backend-protocol: "HTTP" # labels: {} - ingressClassName: "" # nginx - host: "" # crowdsec-api.example.com + ingressClassName: "" # nginx + host: "" # crowdsec-api.example.com # tls: {} dashboard: @@ -136,8 +136,8 @@ lapi: # metabase only supports http so we need this annotation nginx.ingress.kubernetes.io/backend-protocol: "HTTP" # labels: {} - ingressClassName: "" # nginx - host: "" # metabase.example.com + ingressClassName: "" # nginx + host: "" # metabase.example.com # tls: {} resources: @@ -196,11 +196,11 @@ lapi: agent: acquisition: # -- Specify each pod you want to process it logs (namespace, podName and program) - - namespace: "" # ingress-nginx + - namespace: "" # ingress-nginx # -- to select pod logs to process - podName: "" # ingress-nginx-controller-* + podName: "" # ingress-nginx-controller-* # -- program name related to specific parser you will use (see https://hub.crowdsec.net/author/crowdsecurity/configurations/docker-logs) - program: "" # nginx + program: "" # nginx resources: limits: memory: 100Mi