From d30907e53fd5ab0e2be3ff86b02ad7c51bc45555 Mon Sep 17 00:00:00 2001 From: Traver Tischio Date: Tue, 22 Oct 2024 12:02:17 -0400 Subject: [PATCH] Remove unnecessary parentheses in horizon chart --- charts/horizon/templates/_helpers.tpl | 6 +++--- .../horizon/templates/horizon-ingest-cm.yaml | 6 +++--- .../horizon/templates/horizon-ingest-sts.yaml | 18 +++++++++--------- charts/horizon/templates/horizon-ingress.yaml | 8 ++++---- charts/horizon/templates/horizon-web-cm.yaml | 4 ++-- .../templates/horizon-web-deployment.yaml | 14 +++++++------- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/charts/horizon/templates/_helpers.tpl b/charts/horizon/templates/_helpers.tpl index faba348..3ec6fe3 100644 --- a/charts/horizon/templates/_helpers.tpl +++ b/charts/horizon/templates/_helpers.tpl @@ -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 -}} diff --git a/charts/horizon/templates/horizon-ingest-cm.yaml b/charts/horizon/templates/horizon-ingest-cm.yaml index c95ee56..c93ad11 100644 --- a/charts/horizon/templates/horizon-ingest-cm.yaml +++ b/charts/horizon/templates/horizon-ingest-cm.yaml @@ -1,4 +1,4 @@ -{{- if (.Values.ingest).enabled }} +{{- if .Values.ingest.enabled }} --- apiVersion: v1 kind: ConfigMap @@ -22,14 +22,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 }} diff --git a/charts/horizon/templates/horizon-ingest-sts.yaml b/charts/horizon/templates/horizon-ingest-sts.yaml index 455d485..757adc0 100644 --- a/charts/horizon/templates/horizon-ingest-sts.yaml +++ b/charts/horizon/templates/horizon-ingest-sts.yaml @@ -1,4 +1,4 @@ -{{- if (.Values.ingest).enabled }} +{{- if .Values.ingest.enabled }} --- apiVersion: apps/v1 kind: StatefulSet @@ -24,29 +24,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 }} @@ -71,7 +71,7 @@ spec: path: /health initialDelaySeconds: 5 timeoutSeconds: 5 - {{- if (.Values.ingest).resources }} + {{- if .Values.ingest.resources }} resources: {{ toYaml .Values.ingest.resources | indent 10 }} {{- end }} @@ -82,14 +82,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 }} diff --git a/charts/horizon/templates/horizon-ingress.yaml b/charts/horizon/templates/horizon-ingress.yaml index 73ec523..70493b8 100644 --- a/charts/horizon/templates/horizon-ingress.yaml +++ b/charts/horizon/templates/horizon-ingress.yaml @@ -1,4 +1,4 @@ -{{- 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 @@ -7,7 +7,7 @@ metadata: {{- if .Release.Namespace }} namespace: {{ .Release.Namespace }} {{- end }} - {{- if (.Values.ingest.ingress).annotations }} + {{- if .Values.ingest.ingress.annotations }} annotations: {{- range $key, $value := .Values.ingest.ingress.annotations }} {{ $key }}: {{ $value | quote }} @@ -30,7 +30,7 @@ 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 @@ -39,7 +39,7 @@ metadata: {{- if .Release.Namespace }} namespace: {{ .Release.Namespace }} {{- end }} - {{- if (.Values.web.ingress).annotations }} + {{- if .Values.web.ingress.annotations }} annotations: {{- range $key, $value := .Values.web.ingress.annotations }} {{ $key }}: {{ $value | quote }} diff --git a/charts/horizon/templates/horizon-web-cm.yaml b/charts/horizon/templates/horizon-web-cm.yaml index ad3d432..848e846 100644 --- a/charts/horizon/templates/horizon-web-cm.yaml +++ b/charts/horizon/templates/horizon-web-cm.yaml @@ -1,4 +1,4 @@ -{{- if (.Values.web).enabled }} +{{- if .Values.web.enabled }} --- apiVersion: v1 kind: ConfigMap @@ -16,7 +16,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 diff --git a/charts/horizon/templates/horizon-web-deployment.yaml b/charts/horizon/templates/horizon-web-deployment.yaml index ddbdd8d..21cca11 100644 --- a/charts/horizon/templates/horizon-web-deployment.yaml +++ b/charts/horizon/templates/horizon-web-deployment.yaml @@ -1,4 +1,4 @@ -{{- if (.Values.web).enabled }} +{{- if .Values.web.enabled }} --- apiVersion: apps/v1 kind: Deployment @@ -23,29 +23,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 }} @@ -68,7 +68,7 @@ spec: path: /health initialDelaySeconds: 5 timeoutSeconds: 5 - {{- if (.Values.web).resources }} + {{- if .Values.web.resources }} resources: {{ toYaml .Values.web.resources | indent 10 }} {{- end }}