Skip to content

Commit

Permalink
Merge pull request #98 from travertischio/parens-horizon
Browse files Browse the repository at this point in the history
Remove unnecessary parentheses in horizon chart
  • Loading branch information
travertischio authored Oct 22, 2024
2 parents 13412bd + fe155fa commit 0919a5d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions charts/horizon/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{- define "common.name" -}}
{{- default .Chart.Name (.Values.global).nameOverride | trunc 63 | trimSuffix "-" -}}
{{- default .Chart.Name .Values.global.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "common.fullname" -}}
{{- if (.Values.global).fullnameOverride -}}
{{- if .Values.global.fullnameOverride -}}
{{- .Values.global.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name (.Values.global).nameOverride -}}
{{- $name := default .Chart.Name .Values.global.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
Expand Down
6 changes: 3 additions & 3 deletions charts/horizon/templates/ingest-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if (.Values.ingest).enabled }}
{{- if .Values.ingest.enabled }}
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -20,14 +20,14 @@ data:
CAPTIVE_CORE_STORAGE_PATH: "/var/lib/stellar"
CAPTIVE_CORE_USE_DB: {{ .Values.ingest.horizonConfig.captiveCoreUseDb | default "False" | quote}}
CONNECTION_TIMEOUT: {{ .Values.ingest.horizonConfig.connectionTimeout | default "10" | quote}}
{{- if (.Values.ingest.horizonConfig).disablePathFinding }}
{{- if .Values.ingest.horizonConfig.disablePathFinding }}
DISABLE_PATH_FINDING: {{ .Values.ingest.horizonConfig.disablePathFinding | default "False" | quote}}
{{- end }}
ENABLE_ACCOUNTS_FOR_SIGNER: {{ .Values.ingest.horizonConfig.enableAccountsForSigner | default "false" | quote}}
ENABLE_ASSET_STATS: {{ .Values.ingest.horizonConfig.enableAssetStats | default "true" | quote}}
ENABLE_CAPTIVE_CORE_INGESTION: "true"
ENABLE_EXPERIMENTAL_INGESTION: "false"
{{- if (.Values.ingest.horizonConfig).friendbotUrl }}
{{- if .Values.ingest.horizonConfig.friendbotUrl }}
FRIENDBOT_URL: {{ .Values.ingest.horizonConfig.friendbotUrl | default "https://friendbot.stellar.org" | quote}}
{{- end }}
HISTORY_ARCHIVE_URLS: {{ include "horizon.historyArchiveUrls" . | quote }}
Expand Down
18 changes: 9 additions & 9 deletions charts/horizon/templates/ingest-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if (.Values.ingest).enabled }}
{{- if .Values.ingest.enabled }}
---
apiVersion: apps/v1
kind: StatefulSet
Expand All @@ -22,29 +22,29 @@ spec:
app: {{ template "common.fullname" . }}-ingest
release: {{ .Release.Name }}
horizon_network: {{ .Values.global.network }}
{{- if (.Values.ingest).labels }}
{{- if .Values.ingest.labels }}
{{- range $key, $value := .Values.ingest.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if (.Values.ingest).annotations }}
{{- if .Values.ingest.annotations }}
annotations:
{{- range $key, $value := .Values.ingest.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if (.Values.ingest).serviceAccountName }}
{{- if .Values.ingest.serviceAccountName }}
serviceAccountName: {{ .Values.ingest.serviceAccountName | default "default" }}
{{- end }}
{{- if (.Values.global).imagePullSecrets }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.global.imagePullSecrets | indent 8 }}
{{- end }}
containers:
- name: horizon
image: {{ include "common.horizonImage" . | quote }}
{{- if (.Values.ingest).cliArgs }}
{{- if .Values.ingest.cliArgs }}
args:
{{- range $flag := .Values.ingest.cliArgs }}
- {{ $flag | quote }}
Expand All @@ -69,7 +69,7 @@ spec:
path: /health
initialDelaySeconds: 5
timeoutSeconds: 5
{{- if (.Values.ingest).resources }}
{{- if .Values.ingest.resources }}
resources:
{{ toYaml .Values.ingest.resources | indent 10 }}
{{- end }}
Expand All @@ -80,14 +80,14 @@ spec:
- mountPath: /var/lib/stellar
name: {{ template "common.fullname" . }}-ingest-var-lib-stellar
{{- end }}
{{- if (.Values.ingest.coreExporter).enabled }}
{{- if .Values.ingest.coreExporter.enabled }}
- name: stellar-core-prometheus-exporter
image: "{{ .Values.global.image.coreExporter.registry }}/{{ .Values.global.image.coreExporter.repository }}:{{ .Values.global.image.coreExporter.tag }}"
imagePullPolicy: {{ .Values.global.image.coreExporter.pullPolicy }}
ports:
- containerPort: 9473
name: metrics
{{- if (.Values.ingest.coreExporter).resources }}
{{- if .Values.ingest.coreExporter.resources }}
resources:
{{ toYaml .Values.ingest.coreExporter.resources | indent 10 }}
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/horizon/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{- if and (.Values.ingest.enabled) (.Values.ingest.ingress.enabled) }}
{{- if and .Values.ingest.enabled .Values.ingest.ingress.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "common.fullname" . }}-ingest
namespace: {{ .Release.Namespace }}
{{- if (.Values.ingest.ingress).annotations }}
{{- if .Values.ingest.ingress.annotations }}
annotations:
{{- range $key, $value := .Values.ingest.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
Expand All @@ -28,14 +28,14 @@ spec:
port:
number: 80
{{- end }}
{{- if and (.Values.web.enabled) (.Values.web.ingress.enabled) }}
{{- if and .Values.web.enabled .Values.web.ingress.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "common.fullname" . }}-web
namespace: {{ .Release.Namespace }}
{{- if (.Values.web.ingress).annotations }}
{{- if .Values.web.ingress.annotations }}
annotations:
{{- range $key, $value := .Values.web.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
Expand Down
4 changes: 2 additions & 2 deletions charts/horizon/templates/web-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if (.Values.web).enabled }}
{{- if .Values.web.enabled }}
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -14,7 +14,7 @@ data:
INGEST: "false"
PORT: {{ .Values.web.horizonConfig.port | default "8000" | quote}}
ADMIN_PORT: {{ .Values.web.horizonConfig.adminPort | default "6000" | quote}}
{{ if (.Values.web).horizonConfig.stellarCoreUrl -}}
{{ if .Values.web.horizonConfig.stellarCoreUrl -}}
STELLAR_CORE_URL: {{ .Values.web.horizonConfig.stellarCoreUrl | quote}}
{{- else }}
STELLAR_CORE_URL: http://{{ template "common.fullname" . }}-ingest-core:11626
Expand Down
14 changes: 7 additions & 7 deletions charts/horizon/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if (.Values.web).enabled }}
{{- if .Values.web.enabled }}
---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -21,29 +21,29 @@ spec:
app: {{ template "common.fullname" . }}-web
release: {{ .Release.Name }}
horizon_network: {{ .Values.global.network }}
{{- if (.Values.web).labels }}
{{- if .Values.web.labels }}
{{- range $key, $value := .Values.web.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if (.Values.web).annotations }}
{{- if .Values.web.annotations }}
annotations:
{{- range $key, $value := .Values.web.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if (.Values.web).serviceAccountName }}
{{- if .Values.web.serviceAccountName }}
serviceAccountName: {{ .Values.web.serviceAccountName | default "default" }}
{{- end }}
{{- if (.Values.global).imagePullSecrets }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.global.imagePullSecrets | indent 8 }}
{{- end }}
containers:
- name: horizon
image: {{ include "common.horizonImage" . | quote }}
{{- if (.Values.web).cliArgs }}
{{- if .Values.web.cliArgs }}
args:
{{- range $flag := .Values.web.cliArgs }}
- {{ $flag | quote }}
Expand All @@ -66,7 +66,7 @@ spec:
path: /health
initialDelaySeconds: 5
timeoutSeconds: 5
{{- if (.Values.web).resources }}
{{- if .Values.web.resources }}
resources:
{{ toYaml .Values.web.resources | indent 10 }}
{{- end }}
Expand Down

0 comments on commit 0919a5d

Please sign in to comment.