Skip to content

Commit

Permalink
chore: rename enable parameter to enabled (#478)
Browse files Browse the repository at this point in the history
Signed-off-by: Quan Nguyen <[email protected]>
  • Loading branch information
qnswirlds authored Nov 1, 2023
1 parent 1b8c499 commit e488537
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 74 deletions.
6 changes: 3 additions & 3 deletions charts/fullstack-cluster-setup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ dependencies:
alias: minio-operator
version: 5.0.7
repository: https://operator.min.io/
condition: cloud.minio.enable
condition: cloud.minio.enabled

- name: kube-prometheus-stack
alias: prometheus-stack
version: 52.0.1
repository: https://prometheus-community.github.io/helm-charts
condition: cloud.prometheusStack.enable
condition: cloud.prometheusStack.enabled

- name: grafana-agent
version: 0.27.1
repository: https://grafana.github.io/helm-charts
condition: cloud.grafanaAgent.enable
condition: cloud.grafanaAgent.enabled
6 changes: 3 additions & 3 deletions charts/fullstack-cluster-setup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ global:
# cloud configuration
cloud:
minio:
enable: false
enabled: false
prometheusStack:
enable: false
enabled: false
grafanaAgent:
enable: false
enabled: false
6 changes: 3 additions & 3 deletions charts/fullstack-deployment/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ kubeVersion: ">=1.25.0-0"
dependencies:
- name: hedera-explorer
version: 0.2.0
condition: hedera-explorer.enable
condition: hedera-explorer.enabled

- name: hedera-mirror
alias: hedera-mirror-node
version: 0.86.0
repository: https://hashgraph.github.io/hedera-mirror-node/charts
condition: hedera-mirror-node.enable
condition: hedera-mirror-node.enabled

- name: tenant
alias: minio-server
version: 5.0.7
repository: https://operator.min.io/
condition: cloud.minio.enable
condition: cloud.minio.enabled

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exporters:
const_labels:
source: p-{{ default "otel-collector" .otelDefaults.nameOverride }} # PromQL: {source="p-otel-collector"}

{{- if eq .otelDefaults.exporters.prometheusRemoteWrite.enable "true" }}
{{- if eq .otelDefaults.exporters.prometheusRemoteWrite.enabled "true" }}
prometheusremotewrite:
endpoint: "{{ .otelDefaults.exporters.prometheusRemoteWrite.endpoint }}"
tls:
Expand Down Expand Up @@ -55,6 +55,6 @@ service:
processors: [batch]
exporters:
- prometheus
{{- if eq .otelDefaults.exporters.prometheusRemoteWrite.enable "true" }}
{{- if eq .otelDefaults.exporters.prometheusRemoteWrite.enabled "true" }}
- prometheusremotewrite
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- range $index, $node := ($.Values.hedera.nodes) }}
{{- $envoyProxy := $node.envoyProxy | default dict -}}
{{- $defaults := $.Values.defaults.envoyProxy }}
{{- if default $defaults.enable $envoyProxy.enable | eq "true" }}
{{- if default $defaults.enabled $envoyProxy.enabled | eq "true" }}
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
Expand Down
16 changes: 8 additions & 8 deletions charts/fullstack-deployment/templates/gateway-api/gateway.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if $.Values.gatewayApi.gateway.enable | eq "true" }}
{{- if $.Values.gatewayApi.gateway.enabled | eq "true" }}
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
Expand All @@ -14,7 +14,7 @@ spec:
{{- $grpcs_start_port := $.Values.gatewayApi.gateway.listeners.grpcs.port }} # i.e. node0:53000 ... node999: 53999, points to 50212 port in haproxy or network-node
{{- $grpc_web_start_port := $.Values.gatewayApi.gateway.listeners.grpcWeb.port }} # i.e. node0:18000 ... node999: 18999, points to 8080 port in envoy proxy
{{- range $index, $node := $.Values.hedera.nodes }} # we assume to have at most 999 nodes in a single cluster
{{- if $.Values.gatewayApi.gateway.listeners.gossip.enable | eq "true" }}
{{- if $.Values.gatewayApi.gateway.listeners.gossip.enabled | eq "true" }}
{{- $gossip_port := add $index $gossip_start_port }}
- name: gossip-{{ $node.name }} # for exposing gossip port 50111 from network-node
protocol: TCP
Expand All @@ -23,7 +23,7 @@ spec:
kinds:
- kind: TCPRoute
{{- end }}
{{- if $.Values.gatewayApi.gateway.listeners.grpc.enable | eq "true" }}
{{- if $.Values.gatewayApi.gateway.listeners.grpc.enabled | eq "true" }}
{{- $grpc_port := add $index $grpc_start_port }}
- name: grpc-{{ $node.name }} # for exposing grpc port 50211 from haproxy or network-node
protocol: TCP
Expand All @@ -32,7 +32,7 @@ spec:
kinds:
- kind: TCPRoute
{{- end }}
{{- if $.Values.gatewayApi.gateway.listeners.grpcs.enable | eq "true" }}
{{- if $.Values.gatewayApi.gateway.listeners.grpcs.enabled | eq "true" }}
{{- $grpcs_port := add $index $grpcs_start_port }}
- name: grpcs-{{ $node.name }} # for exposing grpc port 50212 from haproxy or network-node
protocol: TCP
Expand All @@ -41,25 +41,25 @@ spec:
kinds:
- kind: TCPRoute
{{- end }}
{{- if $.Values.gatewayApi.gateway.listeners.grpcWeb.enable | eq "true" }}
{{- if $.Values.gatewayApi.gateway.listeners.grpcWeb.enabled | eq "true" }}
{{- $grpc_web_port := add $index $grpc_web_start_port }}
- name: grpc-web-{{ $node.name }} # for exposing grpc-web port 8080 from envoy-proxy
protocol: HTTP
port: {{ $grpc_web_port }}
{{- end }}
{{- end }}
{{- if $.Values.gatewayApi.gateway.listeners.hederaExplorer.enable | eq "true" }}
{{- if $.Values.gatewayApi.gateway.listeners.hederaExplorer.enabled | eq "true" }}
- name: hedera-explorer # for exposing fst-hedera-explorer port 80
protocol: HTTP
port: {{ $.Values.gatewayApi.gateway.listeners.hederaExplorer.port }}
{{- end }}
# Debug ports
{{- if $.Values.gatewayApi.gateway.listeners.httpDebug.enable | eq "true" }}
{{- if $.Values.gatewayApi.gateway.listeners.httpDebug.enabled | eq "true" }}
- name: http-debug # this helps debugging gateway if needed
protocol: HTTP
port: {{ $.Values.gatewayApi.gateway.listeners.httpDebug.port }}
{{- end }}
{{- if $.Values.gatewayApi.gateway.listeners.tcpDebug.enable | eq "true" }}
{{- if $.Values.gatewayApi.gateway.listeners.tcpDebug.enabled | eq "true" }}
- name: tcp-debug # this helps debugging gateway if needed
protocol: TCP
port: {{ $.Values.gatewayApi.gateway.listeners.tcpDebug.port }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- range $index, $node := ($.Values.hedera.nodes) }}
{{- $haproxy := $node.haproxy | default dict -}}
{{- $defaults := $.Values.defaults.haproxy }}
{{- if default $defaults.enable $haproxy.enable | eq "true" }}
{{- if default $defaults.enabled $haproxy.enabled | eq "true" }}
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- range $index, $node := ($.Values.hedera.nodes) }}
{{- $haproxy := $node.haproxy | default dict -}}
{{- $defaults := $.Values.defaults.haproxy }}
{{- if default $defaults.enable $haproxy.enable | eq "false" }}
{{- if default $defaults.enabled $haproxy.enabled | eq "false" }}
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
volumes:
- name: hgcapp-storage # change me
emptyDir: {}
{{- if default $defaults.sidecars.otelCollector.enable $otelCollector.enable | eq "true" }}
{{- if default $defaults.sidecars.otelCollector.enabled $otelCollector.enabled | eq "true" }}
- name: otel-collector-volume
configMap:
name: otel-collector-cm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ range $index, $node := ($.Values.hedera.nodes) }}
{{- $envoyProxy := $node.envoyProxy | default dict -}}
{{- $defaults := $.Values.defaults.envoyProxy }}
{{- if default $defaults.enable $envoyProxy.enable | eq "true" }}
{{- if default $defaults.enabled $envoyProxy.enabled | eq "true" }}
---
apiVersion: apps/v1
kind: Deployment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ range $index, $node := ($.Values.hedera.nodes) }}
{{- $haproxy := $node.haproxy | default dict -}}
{{- $defaults := $.Values.defaults.haproxy }}
{{- if default $defaults.enable $haproxy.enable | eq "true" }}
{{- if default $defaults.enabled $haproxy.enabled | eq "true" }}
---
apiVersion: apps/v1
kind: Deployment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ range $index, $node := ($.Values.hedera.nodes) }}
{{- $envoyProxy := $node.envoyProxy | default dict -}}
{{- $defaults := $.Values.defaults.envoyProxy }}
{{- if default $defaults.enable $envoyProxy.enable | eq "true" }}
{{- if default $defaults.enabled $envoyProxy.enabled | eq "true" }}
---
apiVersion: v1
kind: Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- range $index, $node := ($.Values.hedera.nodes) }}
{{- $haproxy := $node.haproxy | default dict -}}
{{- $defaults := $.Values.defaults.haproxy }}
{{- if default $defaults.enable $haproxy.enable | eq "true" }}
{{- if default $defaults.enabled $haproxy.enabled | eq "true" }}
---
apiVersion: v1
kind: Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- name: DEBUG
value: {{ default $defaults.config.debug ($balanceUploader.config).debug | quote }}
- name: REAPER_ENABLE
value: {{ default $defaults.config.reaper.enable (($balanceUploader.config).reaper).enable | quote }}
value: {{ default $defaults.config.reaper.enabled (($balanceUploader.config).reaper).enabled | quote }}
- name: REAPER_MIN_KEEP
value: {{ default $defaults.config.reaper.minKeep (($balanceUploader.config).reaper).minKeep | quote }}
- name: REAPER_INTERVAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- name: DEBUG
value: {{ default $defaults.config.debug ($eventStream.config).debug | quote}}
- name: REAPER_ENABLE
value: {{ default $defaults.config.reaper.enable (($eventStream.config).reaper).enable | quote }}
value: {{ default $defaults.config.reaper.enabled (($eventStream.config).reaper).enabled | quote }}
- name: REAPER_MIN_KEEP
value: {{ default $defaults.config.reaper.minKeep (($eventStream.config).reaper).minKeep | quote }}
- name: REAPER_INTERVAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- name: DEBUG
value: {{ default $defaults.config.debug ($recordStream.config).debug | quote }}
- name: REAPER_ENABLE
value: {{ default $defaults.config.reaper.enable (($recordStream.config).reaper).enable | quote }}
value: {{ default $defaults.config.reaper.enabled (($recordStream.config).reaper).enabled | quote }}
- name: REAPER_MIN_KEEP
value: {{ default $defaults.config.reaper.minKeep (($recordStream.config).reaper).minKeep | quote }}
- name: REAPER_INTERVAL
Expand Down
10 changes: 5 additions & 5 deletions charts/fullstack-deployment/templates/sidecars/_sidecars.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
{{- $chart := .chart | required "context must include 'chart'!" -}}
{{- $nodeId := .node.accountId -}}
{{- $minioserver := .minioserver -}}
{{- if default $defaults.sidecars.recordStreamUploader.enable $recordStream.enable | eq "true" }}
{{- if default $defaults.sidecars.recordStreamUploader.enabled $recordStream.enabled | eq "true" }}
# Sidecar: Record Stream Uploader
{{- $data := dict "recordStream" $recordStream "cloud" $cloud "chart" $chart "defaults" $defaults.sidecars.recordStreamUploader "nodeId" $nodeId "minioserver" $minioserver -}}
{{ include "fullstack.sidecars.recordStreamUploader" $data | nindent 0 }}
{{- end }}
{{- if default $defaults.sidecars.eventStreamUploader.enable $eventStream.enable | eq "true" }}
{{- if default $defaults.sidecars.eventStreamUploader.enabled $eventStream.enabled | eq "true" }}
# Sidecar: Event Stream Uploader
{{- $data := dict "eventStream" $eventStream "cloud" $cloud "chart" $chart "defaults" $defaults.sidecars.eventStreamUploader "nodeId" $nodeId "minioserver" $minioserver -}}
{{ include "fullstack.sidecars.eventStreamUploader" $data | nindent 0 }}
{{- end }}
{{- if default $defaults.sidecars.accountBalanceUploader.enable $balanceUploader.enable | eq "true" }}
{{- if default $defaults.sidecars.accountBalanceUploader.enabled $balanceUploader.enabled | eq "true" }}
# Sidecar: Account Balance Uploader
{{- $data := dict "balanceUploader" $balanceUploader "cloud" $cloud "chart" $chart "defaults" $defaults.sidecars.accountBalanceUploader "nodeId" $nodeId "minioserver" $minioserver -}}
{{ include "fullstack.sidecars.accountBalanceUploader" $data | nindent 0 }}
{{- end }}
{{- if default $defaults.sidecars.backupUploader.enable $backupUploader.enable | eq "true" }}
{{- if default $defaults.sidecars.backupUploader.enabled $backupUploader.enabled | eq "true" }}
# Sidecar: Backup Uploader
{{- $data := dict "backupUploader" $backupUploader "cloud" $cloud "chart" $chart "defaults" $defaults.sidecars.backupUploader -}}
{{ include "fullstack.sidecars.backupUploader " $data | nindent 0 }}
{{- end }}
{{- if default $defaults.sidecars.otelCollector.enable $otelCollector.enable | eq "true" }}
{{- if default $defaults.sidecars.otelCollector.enabled $otelCollector.enabled | eq "true" }}
# Sidecar: OTel Collector
{{- $data := dict "otel" $otelCollector "chart" $chart "defaults" $defaults.sidecars.otelCollector -}}
{{ include "fullstack.sidecars.otelCollector" $data | nindent 0 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if $.Values.telemetry.prometheus.svcMonitor.enable | eq "true" }}
{{- if $.Values.telemetry.prometheus.svcMonitor.enabled | eq "true" }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ setup() {
[[ -z "${node_name}" ]] && test_status="${FAIL}" && break

local route_name="envoy-grpc-web-route-${node_name}"
local is_enabled=$(is_enabled_for_node "${node_name}" ".envoyProxy.enable")
local is_enabled=$(is_enabled_for_node "${node_name}" ".envoyProxy.enabled")
if [ "${is_enabled}" = "TRUE" ]; then
log_debug "EnvoyProxy enabled for node '${node_name}'"
log_debug "Checking Envoy proxy httproute '${route_name}'"
Expand Down Expand Up @@ -62,7 +62,7 @@ setup() {
[[ -z "${node_name}" ]] && test_status="${FAIL}" && break

local route_name="haproxy-grpc-route-${node_name}"
local is_enabled=$(is_enabled_for_node "${node_name}" ".haproxy.enable")
local is_enabled=$(is_enabled_for_node "${node_name}" ".haproxy.enabled")
if [ "${is_enabled}" = "TRUE" ]; then
log_debug "HAProxy enabled for node '${node_name}'"
log_debug "Checking HAProxy GRPC route '${route_name}'"
Expand Down Expand Up @@ -101,7 +101,7 @@ setup() {
[[ -z "${node_name}" ]] && test_status="${FAIL}" && break

local route_name="node-grpc-route-${node_name}"
local is_enabled=$(is_enabled_for_node "${node_name}" ".haproxy.enable")
local is_enabled=$(is_enabled_for_node "${node_name}" ".haproxy.enabled")
if [ "${is_enabled}" = "FALSE" ]; then
log_debug "Checking Node GRPC route '${route_name}'"
is_route_accepted "tcproute" "${route_name}" || test_status="${FAIL}"
Expand Down
4 changes: 2 additions & 2 deletions charts/fullstack-deployment/tests/test_proxy_deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ setup() {
local node_name=$(get_pod_label "${pod}" "fullstack.hedera.com/node-name")
[[ -z "${node_name}" ]] && test_status="${FAIL}" && break

local is_enabled=$(is_enabled_for_node "${node_name}" ".haproxy.enable")
local is_enabled=$(is_enabled_for_node "${node_name}" ".haproxy.enabled")
if [ "${is_enabled}" = "TRUE" ]; then
log_debug "HAProxy is enabled for node '${node_name}'"
log_debug "Checking HAProxy for network-node '${node_name}'"
Expand Down Expand Up @@ -63,7 +63,7 @@ setup() {
local node_name=$(get_pod_label "${pod}" "fullstack.hedera.com/node-name")
[[ -z "${node_name}" ]] && test_status="${FAIL}" && break

local is_enabled=$(is_enabled_for_node "${node_name}" ".envoyProxy.enable")
local is_enabled=$(is_enabled_for_node "${node_name}" ".envoyProxy.enabled")
if [ "${is_enabled}" = "TRUE" ]; then
log_debug "EnvoyProxy is enabled for node '${node_name}'"
log_debug "Checking Envoy proxy for network-node '${node_name}'"
Expand Down
10 changes: 5 additions & 5 deletions charts/fullstack-deployment/tests/test_sidecar_deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,35 @@ function run_default_sidecar_check() {

@test "Check record-stream-uploader sidecar" {
local sidecar_name="record-stream-uploader"
local enable_config_path=".defaults.sidecars.recordStreamUploader.enable"
local enable_config_path=".defaults.sidecars.recordStreamUploader.enabled"

run_default_sidecar_check "${sidecar_name}" "${enable_config_path}"
}

@test "Check event-stream-uploader sidecar" {
local sidecar_name="event-stream-uploader"
local enable_config_path=".defaults.sidecars.eventStreamUploader.enable"
local enable_config_path=".defaults.sidecars.eventStreamUploader.enabled"

run_default_sidecar_check "${sidecar_name}" "${enable_config_path}"
}

@test "Check account-balance-uploader sidecar" {
local sidecar_name="account-balance-uploader"
local enable_config_path=".defaults.sidecars.accountBalanceUploader.enable"
local enable_config_path=".defaults.sidecars.accountBalanceUploader.enabled"

run_default_sidecar_check "${sidecar_name}" "${enable_config_path}"
}

@test "Check backup-uploader sidecar" {
local sidecar_name="backup-uploader"
local enable_config_path=".defaults.sidecars.backupUploader.enable"
local enable_config_path=".defaults.sidecars.backupUploader.enabled"

run_default_sidecar_check "${sidecar_name}" "${enable_config_path}"
}

@test "Check otel-collector sidecar" {
local sidecar_name="otel-collector"
local enable_config_path=".defaults.sidecars.otelCollector.enable"
local enable_config_path=".defaults.sidecars.otelCollector.enabled"

run_default_sidecar_check "${sidecar_name}" "${enable_config_path}"
}
Loading

0 comments on commit e488537

Please sign in to comment.