Skip to content

Commit 604350a

Browse files
authored
Fix formatting of resource names (#773)
Minor fixes to the ordering of attributes in the generated template, to make them more consistent, thus easier to read ### Checklist - [x] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md) - [ ] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md) - [ ] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes) ### Test plan Tested on branch [marc-test-helm-fixes](https://github.com/sourcegraph/deploy-sourcegraph-helm/tree/marc-test-helm-fixes) on my EKS test instance, works great, no errors <!-- As part of SOC2/GN-104 and SOC2/GN-105 requirements, all pull requests are REQUIRED to provide a "test plan". A test plan is a loose explanation of what you have done or implemented to test this, as outlined in our Testing principles and guidelines: https://docs.sourcegraph.com/dev/background-information/testing_principles Write your test plan here after the "Test plan" header. -->
1 parent 462da58 commit 604350a

23 files changed

+61
-59
lines changed

charts/sourcegraph/templates/cadvisor/cadvisor.ClusterRoleBinding.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ roleRef:
1313
kind: ClusterRole
1414
name: {{ .Values.cadvisor.name }}
1515
subjects:
16-
- kind: ServiceAccount
17-
name: {{ include "sourcegraph.serviceAccountName" (list . "cadvisor") }}
16+
- name: {{ include "sourcegraph.serviceAccountName" (list . "cadvisor") }}
17+
kind: ServiceAccount
1818
namespace: {{ .Release.Namespace }}
1919
{{- end }}

charts/sourcegraph/templates/cadvisor/cadvisor.DaemonSet.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ spec:
9494
- name: http
9595
containerPort: 48080
9696
protocol: TCP
97-
automountServiceAccountToken: false
98-
terminationGracePeriodSeconds: 30
9997
{{- if .Values.cadvisor.extraContainers }}
10098
{{- toYaml .Values.cadvisor.extraContainers | nindent 6 }}
10199
{{- end }}
100+
automountServiceAccountToken: false
101+
terminationGracePeriodSeconds: 30
102102
securityContext:
103103
{{- toYaml .Values.cadvisor.podSecurityContext | nindent 8 }}
104104
{{- include "sourcegraph.nodeSelector" (list . "cadvisor" ) | trim | nindent 6 }}

charts/sourcegraph/templates/codeintel-db/codeintel-db.StatefulSet.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ spec:
5858
{{- toYaml .Values.alpine.resources | nindent 10 }}
5959
{{- end }}
6060
containers:
61-
- name: pgsql
61+
- name: pgsql # TODO: Evaluate renaming container to codeintel
6262
image: {{ include "sourcegraph.image" (list . "codeIntelDB") }}
6363
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
6464
{{- with .Values.codeIntelDB.args }}
@@ -108,9 +108,6 @@ spec:
108108
{{- if .Values.codeIntelDB.extraVolumeMounts }}
109109
{{- toYaml .Values.codeIntelDB.extraVolumeMounts | nindent 8 }}
110110
{{- end }}
111-
{{- if .Values.codeIntelDB.extraContainers }}
112-
{{- toYaml .Values.codeIntelDB.extraContainers | nindent 6 }}
113-
{{- end }}
114111
- name: pgsql-exporter
115112
env:
116113
{{- include "sourcegraph.dataSource" (list . "codeIntelDB" ) | nindent 8 }}
@@ -131,6 +128,9 @@ spec:
131128
securityContext:
132129
{{- toYaml .Values.postgresExporter.containerSecurityContext | nindent 10 }}
133130
terminationMessagePolicy: FallbackToLogsOnError
131+
{{- if .Values.codeIntelDB.extraContainers }}
132+
{{- toYaml .Values.codeIntelDB.extraContainers | nindent 6 }}
133+
{{- end }}
134134
terminationGracePeriodSeconds: 120
135135
securityContext:
136136
{{- toYaml .Values.codeIntelDB.podSecurityContext | nindent 8 }}

charts/sourcegraph/templates/frontend/sourcegraph-frontend.Deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
{{- range $name, $item := .Values.migrator.env }}
6666
- name: {{ $name }}
6767
{{- $item | toYaml | nindent 10 }}
68-
{{- end }}
68+
{{- end }}
6969
{{- if not .Values.sourcegraph.localDevMode}}
7070
resources:
7171
{{- toYaml .Values.migrator.resources | nindent 10 }}
@@ -151,8 +151,8 @@ spec:
151151
{{- end }}
152152
{{- include "sourcegraph.renderServiceAccountName" (list . "frontend") | trim | nindent 6 }}
153153
volumes:
154-
- emptyDir: {}
155-
name: home-dir
154+
- name: home-dir
155+
emptyDir: {}
156156
{{- if .Values.frontend.extraVolumes }}
157157
{{- toYaml .Values.frontend.extraVolumes | nindent 6 }}
158158
{{- end }}

charts/sourcegraph/templates/frontend/sourcegraph-frontend.RoleBinding.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ roleRef:
1919
name: view
2020
{{- end }}
2121
subjects:
22-
- kind: ServiceAccount
23-
name: {{ include "sourcegraph.serviceAccountName" (list . "frontend") }}
22+
- name: {{ include "sourcegraph.serviceAccountName" (list . "frontend") }}
23+
kind: ServiceAccount
2424
namespace: {{ .Release.Namespace }}
2525
{{- end }}

charts/sourcegraph/templates/grafana/grafana.pgsql.Secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
apiVersion: v1
33
kind: Secret
44
metadata:
5-
name: {{ .Values.grafana.name }}-auth
65
labels:
76
app: grafana
87
deploy: sourcegraph
98
app.kubernetes.io/component: grafana
9+
name: {{ .Values.grafana.name }}-auth
1010
type: Opaque
1111
data:
1212
database: {{ .Values.grafana.auth.database | toString | b64enc | quote }}

charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
apiVersion: apps/v1
66
kind: Deployment
77
metadata:
8-
name: {{ .Values.jaeger.name }}
98
labels:
109
{{- include "sourcegraph.jaeger.labels" . | nindent 4 }}
1110
{{- if .Values.jaeger.labels }}
@@ -14,6 +13,7 @@ metadata:
1413
deploy: sourcegraph
1514
app.kubernetes.io/component: all-in-one
1615
app: jaeger
16+
name: {{ .Values.jaeger.name }}
1717
spec:
1818
replicas: {{ .Values.jaeger.replicaCount }}
1919
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}

charts/sourcegraph/templates/node-exporter/node-exporter.ClusterRoleBinding.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ roleRef:
1313
kind: ClusterRole
1414
name: {{ .Values.nodeExporter.name }}
1515
subjects:
16-
- kind: ServiceAccount
17-
name: {{ include "sourcegraph.serviceAccountName" (list . "nodeExporter") }}
16+
- name: {{ include "sourcegraph.serviceAccountName" (list . "nodeExporter") }}
17+
kind: ServiceAccount
1818
namespace: {{ .Release.Namespace }}
1919
{{- end }}

charts/sourcegraph/templates/node-exporter/node-exporter.DaemonSet.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ spec:
5858
- --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/)
5959
- --collector.netclass.ignored-devices=^(veth.*)$
6060
- --collector.netdev.device-exclude=^(veth.*)$
61-
{{- if .Values.nodeExporter.extraArgs }}
62-
{{ toYaml .Values.nodeExporter.extraArgs | indent 10 }}
63-
{{- end }}
61+
{{- if .Values.nodeExporter.extraArgs }}
62+
{{ toYaml .Values.nodeExporter.extraArgs }}
63+
{{- end }}
6464
env:
6565
{{- range $name, $item := .Values.nodeExporter.env}}
6666
- name: {{ $name }}
@@ -111,11 +111,11 @@ spec:
111111
successThreshold: 1
112112
timeoutSeconds: 1
113113
terminationMessagePolicy: FallbackToLogsOnError
114-
automountServiceAccountToken: false
115-
terminationGracePeriodSeconds: 30
116114
{{- if .Values.nodeExporter.extraContainers }}
117115
{{- toYaml .Values.nodeExporter.extraContainers | nindent 6 }}
118116
{{- end }}
117+
automountServiceAccountToken: false
118+
terminationGracePeriodSeconds: 30
119119
securityContext:
120120
{{- toYaml .Values.nodeExporter.podSecurityContext | nindent 8 }}
121121
{{- include "sourcegraph.nodeSelector" (list . "nodeExporter" ) | trim | nindent 6 }}

charts/sourcegraph/templates/otel-collector/otel-agent.ConfigMap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Config for the agent pods running as a DaemonSet, which forward data to the gateway pod
21
{{ if .Values.openTelemetry.enabled -}}
2+
# Config for the agent pods running as a DaemonSet, which forward data to the gateway pod
33
apiVersion: v1
44
kind: ConfigMap
55
metadata:

0 commit comments

Comments
 (0)