mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 06:49:17 -03:00
allow crd verification to be disabled and disable on both lint and unittests
This commit is contained in:
2
.github/ct-install-config/ct-lint.yaml
vendored
2
.github/ct-install-config/ct-lint.yaml
vendored
@@ -1,6 +1,6 @@
|
||||
remote: origin
|
||||
target-branch: master
|
||||
helm-extra-args: --debug
|
||||
helm-extra-args: --debug --set crd.verify.enabled=false
|
||||
chart-yaml-schema: .github/ct-install-config/chart_schema.yaml
|
||||
chart-dirs:
|
||||
- library
|
||||
|
||||
2
.github/workflows/common_library_tests.yaml
vendored
2
.github/workflows/common_library_tests.yaml
vendored
@@ -92,7 +92,7 @@ jobs:
|
||||
# Run tests
|
||||
cd library/common-test/
|
||||
helm dependency update
|
||||
helm unittest -f "tests/**/*.yaml" .
|
||||
helm unittest -f "tests/**/*.yaml" . --set crd.verify.enabled=false
|
||||
|
||||
install:
|
||||
needs:
|
||||
|
||||
@@ -14,7 +14,7 @@ objectData:
|
||||
{{- $rootCtx := .rootCtx -}}
|
||||
{{- $objectData := .objectData }}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "ertificates.cert-manager.io" "missing" "Cert-Manager") }}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "ertificates.cert-manager.io" "missing" "Cert-Manager") }}
|
||||
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{{- $backupAnnotations := $objectData.backupAnnotations | default dict -}}
|
||||
{{- $backupAnnotations = mustMerge $backupAnnotations $objAnnotations $globalBackupAnnotations }}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "backups.postgresql.cnpg.io" "missing" "CloudNative-PG") }}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "backups.postgresql.cnpg.io" "missing" "CloudNative-PG") }}
|
||||
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
{{- $walSize = . -}}
|
||||
{{- end }}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "clusters.postgresql.cnpg.io" "missing" "CloudNative-PG") }}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "clusters.postgresql.cnpg.io" "missing" "CloudNative-PG") }}
|
||||
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
{{- $instances = 0 -}}
|
||||
{{- end }}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "poolers.postgresql.cnpg.io" "missing" "CloudNative-PG") }}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "poolers.postgresql.cnpg.io" "missing" "CloudNative-PG") }}
|
||||
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
{{- $immediate = $objectData.schedData.immediate -}}
|
||||
{{- end }}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "scheduledbackups.postgresql.cnpg.io" "missing" "CloudNative-PG") }}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "scheduledbackups.postgresql.cnpg.io" "missing" "CloudNative-PG") }}
|
||||
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
|
||||
@@ -15,7 +15,7 @@ objectData:
|
||||
{{- $rootCtx := .rootCtx -}}
|
||||
{{- $objectData := .objectData }}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "backupstoragelocations.velero.io" "missing" "Velero") }}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "backupstoragelocations.velero.io" "missing" "Velero") }}
|
||||
|
||||
---
|
||||
apiVersion: velero.io/v1
|
||||
|
||||
@@ -26,7 +26,7 @@ objectData:
|
||||
{{- $namespace = ($lookupBSL.items | first).metadata.namespace -}}
|
||||
{{- end }}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "schedules.velero.io" "missing" "Velero") }}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "schedules.velero.io" "missing" "Velero") }}
|
||||
|
||||
---
|
||||
apiVersion: velero.io/v1
|
||||
|
||||
@@ -15,7 +15,7 @@ objectData:
|
||||
{{- $rootCtx := .rootCtx -}}
|
||||
{{- $objectData := .objectData }}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "volumesnapshotlocations.velero.io" "missing" "Velero") }}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "volumesnapshotlocations.velero.io" "missing" "Velero") }}
|
||||
|
||||
---
|
||||
apiVersion: velero.io/v1
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
{{- fail (printf "Ingress - Combined traefik entrypoints contain duplicates [%s]" (join ", " $entrypoints)) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "middlewares.traefik.io" "missing" "Traefik") -}}
|
||||
{{- include "tc.v1.common.lib.util.verifycrd" (dict "rootCtx" $rootCtx "crd" "middlewares.traefik.io" "missing" "Traefik") -}}
|
||||
|
||||
{{- $lookupMiddlewares := list -}}
|
||||
{{- $parsedMiddlewares := list -}}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{{- define "tc.v1.common.lib.util.verifycrd" -}}
|
||||
{{- $crd := .crd -}}
|
||||
{{- $missing := .missing | default (printf "Missing CRDs for %s" $crd) -}}
|
||||
{{- $rootCtx := .rootCtx -}}
|
||||
|
||||
{{- $lookupMiddlewares := (lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" $crd) -}}
|
||||
|
||||
{{/* If there are items, re-assign the variable */}}
|
||||
{{- if $lookupMiddlewares -}}
|
||||
{{- else -}}
|
||||
{{- fail (printf "%s have to be installed first" $missing) -}}
|
||||
{{- if $rootCtx.crd.verify.enabled -}}
|
||||
{{- $lookupMiddlewares := (lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" $crd) -}}
|
||||
{{/* If there are items, re-assign the variable */}}
|
||||
{{- if $lookupMiddlewares -}}
|
||||
{{- else -}}
|
||||
{{- fail (printf "%s has to be installed first" $missing) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -855,6 +855,10 @@ metrics:
|
||||
# # list to support adding rules via the SCALE GUI without overwrithing the rules
|
||||
# additionalrules: []
|
||||
|
||||
crd:
|
||||
verify:
|
||||
enabled: true
|
||||
|
||||
# -- Contains specific settings for helm charts containing or using operators
|
||||
operator:
|
||||
# -- Adds a configmap to the operator to register this chart as an operator
|
||||
|
||||
Reference in New Issue
Block a user