Adding open-appsec-kong helm chart to repo based on kong 2.16.1

This commit is contained in:
roybarda
2023-05-02 14:30:33 +03:00
parent 2c750513a1
commit 240f58217a
132 changed files with 17727 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
{{- $installCRDs := false -}}
{{- if (hasKey .Values.ingressController "installCRDs") -}}
{{/* Explicitly set, honor whatever's set */}}
{{- $installCRDs = .Values.ingressController.installCRDs -}}
{{- else -}}
{{/* Legacy default handling. CRD installation is _not_ enabled, but CRDs are already present
and are managed by this release. This release previously relied on the <2.0 default
.Values.ingressController.installCRDs=true. The default change would delete CRDs on upgrade,
which would cascade delete all associated CRs. This unexpected loss of configuration is bad,
so this clause pretends the default didn't change if you have an existing release that relied
on it
*/}}
{{- $kongPluginCRD := false -}}
{{- if .Capabilities.APIVersions.Has "apiextensions.k8s.io/v1/CustomResourceDefinition" -}}
{{- $kongPluginCRD = (lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" "kongplugins.configuration.konghq.com") -}}
{{- else -}}
{{/* TODO: remove the v1beta1 path when we no longer support k8s <1.16 */}}
{{- $kongPluginCRD = (lookup "apiextensions.k8s.io/v1beta1" "CustomResourceDefinition" "" "kongplugins.configuration.konghq.com") -}}
{{- end -}}
{{- if $kongPluginCRD -}}
{{- if (hasKey $kongPluginCRD.metadata "annotations") -}}
{{- if (eq .Release.Name (get $kongPluginCRD.metadata.annotations "meta.helm.sh/release-name")) -}}
{{- $installCRDs = true -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if $installCRDs -}}
{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }}
{{ $.Files.Get $path }}
---
{{- end }}
{{- end }}