Skip to content

Commit 15b5c10

Browse files
authored
Fix chart to work with old service name (#40)
1 parent 6acd91b commit 15b5c10

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

charts/git-auth-proxy/templates/deployment.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
template:
1515
metadata:
1616
annotations:
17-
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
17+
checksum/config: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
1818
{{- with .Values.podAnnotations }}
1919
{{- toYaml . | nindent 8 }}
2020
{{- end }}
@@ -38,6 +38,8 @@ spec:
3838
{{- toYaml .Values.securityContext | nindent 12 }}
3939
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4040
imagePullPolicy: {{ .Values.image.pullPolicy }}
41+
args:
42+
- "--config=/var/config.json"
4143
ports:
4244
- name: http
4345
containerPort: 8080
@@ -57,12 +59,12 @@ spec:
5759
{{- toYaml .Values.resources | nindent 12 }}
5860
volumeMounts:
5961
- name: config
60-
mountPath: "/var/"
62+
mountPath: "/var"
6163
readOnly: true
6264
volumes:
6365
- name: config
64-
configMap:
65-
name: {{ include "git-auth-proxy.fullname" . }}
66+
secret:
67+
secretName: {{ include "git-auth-proxy.fullname" . }}
6668
{{- if .Values.priorityClassName }}
6769
priorityClassName: {{ .Values.priorityClassName }}
6870
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
2-
kind: ConfigMap
2+
kind: Secret
33
metadata:
44
name: {{ include "git-auth-proxy.fullname" . }}
55
labels:
66
{{- include "git-auth-proxy.labels" . | nindent 4 }}
7-
data:
7+
stringData:
88
config.json: {{ required "Config has to be set." .Values.config | quote }}

charts/git-auth-proxy/templates/service.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,25 @@ spec:
1717
name: metrics
1818
selector:
1919
{{- include "git-auth-proxy.selectorLabels" . | nindent 4 }}
20+
---
21+
# This service is left for legacy reasons as the project used to be called azdo-proxy.
22+
# The service should be removed eventually as all applications change the service name they use.
23+
apiVersion: v1
24+
kind: Service
25+
metadata:
26+
name: azdo-proxy
27+
labels:
28+
{{- include "git-auth-proxy.labels" . | nindent 4 }}
29+
spec:
30+
type: {{ .Values.service.type }}
31+
ports:
32+
- port: {{ .Values.service.port }}
33+
targetPort: http
34+
protocol: TCP
35+
name: http
36+
- port: {{ .Values.service.metricsPort }}
37+
targetPort: metrics
38+
protocol: TCP
39+
name: metrics
40+
selector:
41+
{{- include "git-auth-proxy.selectorLabels" . | nindent 4 }}

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ import (
2929
)
3030

3131
type cfg struct {
32-
Addr string `flag:"addr" default:":8080"`
33-
MetricsAddr string `flag:"metrics-addr" default:":9090"`
32+
Addr string `flag:"addr" default:":8080" required:"true"`
33+
MetricsAddr string `flag:"metrics-addr" default:":9090" required:"true"`
34+
ConfigPath string `flag:"config" required:"true"`
3435
KubeconfigPath string `flag:"kubeconfig"`
35-
ConfigPath string `flag:"config"`
3636
}
3737

3838
func main() {

0 commit comments

Comments
 (0)