Skip to content

Commit

Permalink
fix: variable scope in templates
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
  • Loading branch information
leninmehedy committed Sep 18, 2023
1 parent d8ce3ad commit ca141d7
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion charts/hedera-network/templates/configmaps/envoy-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: envoy-proxy-cm-{{ $node.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
data:
envoy.yaml: |
{{- tpl ($.Files.Get "config-files/envoy.yaml") (dict "nodeConfig" $node "Template" $.Template) | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/hedera-network/templates/configmaps/haproxy-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-cm-{{ $node.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
data:
haproxy.cfg: |
{{- tpl ($.Files.Get "config-files/haproxy.cfg") (dict "nodeConfig" $node "Template" $.Template) | nindent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-cm
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
data:
config.yaml: |
{{- tpl (.Files.Get "config-files/otel-collector-config.yaml") ( dict "otelDefaults" $.Values.defaults.sidecars.otelCollector "Template" $.Template ) | nindent 4 }}
2 changes: 1 addition & 1 deletion charts/hedera-network/templates/configmaps/test-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: test-cm
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
data:
{{- $total_nodes := len $.Values.hedera.nodes -}}
{{- range $path, $_ := .Files.Glob "tests/*.*" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: envoy-grpc-web-route-{{ $node.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: http-route
spec:
Expand Down
4 changes: 2 additions & 2 deletions charts/hedera-network/templates/gateway-api/gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1
kind: GatewayClass
metadata:
name: {{ $.Values.gatewayApi.gatewayClass.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: gateway-class
spec:
Expand All @@ -15,7 +15,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: {{ $.Values.gatewayApi.gateway.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: gateway
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
name: haproxy-grpc-route-{{ $node.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: tcp-route
fullstack.hedera.com/nodeName: {{ $node.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
name: node-grpc-route-{{ $node.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: tcp-route
fullstack.hedera.com/nodeName: {{ $node.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: network-{{ $node.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
app: network-{{ $node.name }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: envoy-proxy-{{ $node.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
spec:
replicas: 1
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: haproxy-{{ $node.name }}
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
spec:
replicas: 1
selector:
Expand Down
6 changes: 3 additions & 3 deletions charts/hedera-network/templates/rbac/pod-monitor-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pod-monitoring-role
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
rules:
- apiGroups: [ "" ]
resources:
Expand Down Expand Up @@ -31,11 +31,11 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: pod-monitoring-role-binding
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
subjects:
- kind: ServiceAccount
name: pod-monitor
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
roleRef:
kind: ClusterRole
name: pod-monitoring-role
Expand Down
2 changes: 1 addition & 1 deletion charts/hedera-network/templates/rbac/service-accounts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-monitor
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: backup-uploader-secrets
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
type: Opaque
data:
S3_ACCESS_KEY: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: otel-collector-secrets
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
type: Opaque
data:
S3_ACCESS_KEY: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: v1
kind: Secret
metadata:
name: minio-secrets
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
type: Opaque
data:
config.env: {{ $minio_config_env | b64enc }}
Expand Down
2 changes: 1 addition & 1 deletion charts/hedera-network/templates/services/envoy-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: v1
kind: Service
metadata:
name: envoy-proxy-{{ $node.name }}-svc
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: envoy-proxy-svc
fullstack.hedera.com/node-name: {{ $node.name }}
Expand Down
2 changes: 1 addition & 1 deletion charts/hedera-network/templates/services/haproxy-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: v1
kind: Service
metadata:
name: haproxy-{{ $node.name }}-svc
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: haproxy-svc
fullstack.hedera.com/node-name: {{ $node.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Service
metadata:
name: network-{{ $nodeConfig.name }}-svc
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: network-node-svc
fullstack.hedera.com/node-name: {{ $nodeConfig.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: network-node-monitor
namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }}
namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }}
labels:
fullstack.hedera.com/type: network-node-svc-monitor
spec:
Expand Down

0 comments on commit ca141d7

Please sign in to comment.