Skip to content

Commit

Permalink
Merge pull request #6 from devops-ia/fix/default-env-opencti-connector
Browse files Browse the repository at this point in the history
Fix reference env for worker and connector
  • Loading branch information
ialejandro authored Jul 21, 2024
2 parents d64c8a3 + a24a4a7 commit 2adb74a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions opencti/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ maintainers:
url: https://ialejandro.rocks
sources:
- https://github.com/OpenCTI-Platform/opencti
version: 1.2.6
version: 1.2.7
appVersion: "6.2.6"
home: https://www.filigran.io/en/solutions/products/opencti/
keywords:
Expand All @@ -20,7 +20,7 @@ dependencies:
condition: elasticsearch.enabled
- name: minio
version: 14.6.*
repository: https://charts.bitnami.com/bitnami
repository: https://charts.bitnami.com/bitnami
condition: minio.enabled
- name: opensearch
version: 2.21.*
Expand Down
5 changes: 3 additions & 2 deletions opencti/templates/connector/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
{{- end }}

# Special handling for OPENCTI_URL which is constructed from other values
{{- if not (hasKey $envList "OPENCTI_URL") }}
{{- if not (hasKey .env "OPENCTI_URL") }}
{{- if eq $.Values.env.APP__BASE_PATH "/" }}
- name: OPENCTI_URL
value: "http://{{ include "opencti.fullname" $ }}-server:{{ $.Values.service.port }}"
Expand All @@ -79,7 +79,8 @@ spec:
{{- end }}
{{- end }}

{{- if and (not (hasKey $envList "OPENCTI_TOKEN")) ($.Values.env.APP__ADMIN__TOKEN) }}
# Special handling for OPENCTI_TOKEN which is constructed from other values
{{- if and (not (hasKey .env "OPENCTI_TOKEN")) ($.Values.env.APP__ADMIN__TOKEN) }}
- name: OPENCTI_TOKEN
value: "{{ $.Values.env.APP__ADMIN__TOKEN }}"
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions opencti/templates/worker/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ spec:
{{- end }}
env:
# Variables from secrets have precedence

{{- $envList := dict -}}

{{- if .Values.worker.envFromSecrets }}
Expand All @@ -90,6 +89,7 @@ spec:
{{- end }}
{{- end }}

# Special handling for OPENCTI_TOKEN which is constructed from other values
{{- if and (not (hasKey $envList "OPENCTI_TOKEN")) (.Values.env.APP__ADMIN__TOKEN) }}
- name: OPENCTI_TOKEN
value: "{{ .Values.env.APP__ADMIN__TOKEN }}"
Expand Down Expand Up @@ -120,4 +120,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 2adb74a

Please sign in to comment.