From e7cc87808ecaa7c3012196e2a2798ed64662fd6c Mon Sep 17 00:00:00 2001 From: Thierry GAMEIRO MARTINS Date: Tue, 1 Oct 2024 15:41:41 +0200 Subject: [PATCH] feat: :sparkles: add cacert with schema --- charts/vscode-python/Chart.yaml | 2 +- charts/vscode-python/templates/statefulset.yaml | 16 ++++++++-------- charts/vscode-python/values.schema.json | 11 ++++++----- charts/vscode-python/values.yaml | 6 +++--- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/charts/vscode-python/Chart.yaml b/charts/vscode-python/Chart.yaml index 51bf7520..3fb84c64 100644 --- a/charts/vscode-python/Chart.yaml +++ b/charts/vscode-python/Chart.yaml @@ -22,7 +22,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.3 +version: 2.1.4 dependencies: - name: library-chart diff --git a/charts/vscode-python/templates/statefulset.yaml b/charts/vscode-python/templates/statefulset.yaml index da788f0b..482ddfc0 100644 --- a/charts/vscode-python/templates/statefulset.yaml +++ b/charts/vscode-python/templates/statefulset.yaml @@ -100,14 +100,14 @@ spec: mkdir /dest/metaflow; cp /src/metaflow/config.json /dest/metaflow/config.json; {{- end }} - {{- if .Values.certificateAuthorityInjection }} - {{- if .Values.certificateAuthorityInjection.cacerts }} + {{- if .Values.certificates }} + {{- if .Values.certificates.cacerts }} mkdir /dest/certs; - if [[ {{ .Values.certificateAuthorityInjection.cacerts }} =~ ^https?://.+$ ]]; + if [[ {{ .Values.certificates.cacerts }} =~ ^https?://.+$ ]]; then - curl -s {{ .Values.certificateAuthorityInjection.cacerts }} -o /tmp/ca.pem + curl -s {{ .Values.certificates.cacerts }} -o /tmp/ca.pem else - echo -n {{ .Values.certificateAuthorityInjection.cacerts }} | base64 -d > /tmp/ca.pem; + echo -n {{ .Values.certificates.cacerts }} | base64 -d > /tmp/ca.pem; fi awk 'BEGIN {c=0;} /BEGIN CERT/{c++} { print > "/tmp/cert." c ".crt"}' < /tmp/ca.pem; cp /tmp/*.crt /dest/certs/; @@ -231,10 +231,10 @@ spec: mountPath: /home/{{ .Values.environment.user}}/.metaflowconfig subPath: metaflow {{- end }} - {{- if .Values.certificateAuthorityInjection }} - {{- if .Values.certificateAuthorityInjection.pathToCaBundle }} + {{- if .Values.certificates }} + {{- if .Values.certificates.pathToCaBundle }} - name: config-files - mountPath: {{ .Values.certificateAuthorityInjection.pathToCaBundle }} + mountPath: {{ .Values.certificates.pathToCaBundle }} subPath: certs {{- end }} {{- end }} diff --git a/charts/vscode-python/values.schema.json b/charts/vscode-python/values.schema.json index ed2962fb..281b7432 100644 --- a/charts/vscode-python/values.schema.json +++ b/charts/vscode-python/values.schema.json @@ -837,9 +837,12 @@ } } }, - "certificateAuthorityInjection": { + "certificates": { "description": "It can be used to inject certificate authority into the services, if the Helm chart in the catalog allows it you can bind this value to the Helm chart value to add some certificate authorities in the pod.", "type": "object", + "x-onyxia": { + "overwriteSchemaWith": "certificates.json" + }, "default": {}, "properties": { "cacerts": { @@ -847,8 +850,7 @@ "description": "String of crts concatenated in base64, can be a url", "default": "", "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{certificateAuthorityInjection.cacerts}}" + "hidden": true } }, "pathToCaBundle": { @@ -856,8 +858,7 @@ "description": "String path where a bundle is made or injected by third party solution", "default": "/usr/local/share/ca-certificates/", "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{certificateAuthorityInjection.pathToCaBundle}}" + "hidden": true } } } diff --git a/charts/vscode-python/values.yaml b/charts/vscode-python/values.yaml index 2aadf3f6..8424e490 100644 --- a/charts/vscode-python/values.yaml +++ b/charts/vscode-python/values.yaml @@ -221,9 +221,9 @@ proxy: httpProxy: "" httpsProxy: "" -# certificateAuthorityInjection: -# pathToCaBundle: -# cacerts: +certificates: {} + # pathToCaBundle: /usr/local/share/ca-certificates/ + # cacerts: "" message: fr: ""