|
90 | 90 | {{- print "example.com" -}} |
91 | 91 | {{- end -}} |
92 | 92 | {{- end -}} |
93 | | - |
94 | | -{{- define "gitlab.root_password" -}} |
95 | | -{{- $secretName := (printf "%v-credentials" .Values.gitlab.app_name) -}} |
96 | | -{{- $password := default (randAlphaNum 10) .Values.gitlab.credentials.root_password }} |
97 | | -{{- if not .Values.gitlab.credentials.root_password }} |
98 | | -{{- $existingSecret := (lookup "v1" "Secret" .Values.gitlab.namespace $secretName) }} |
99 | | -{{- if $existingSecret }} |
100 | | -{{- $password = index $existingSecret.data "root_password" | b64dec }} |
101 | | -{{- end -}} |
102 | | -{{- end -}} |
103 | | -{{- print $password -}} |
104 | | -{{- end -}} |
105 | | - |
106 | | -{{- define "gitlab.postgres.user" -}} |
107 | | -{{- $secretName := (printf "%v-credentials" .Values.gitlab.app_name) -}} |
108 | | -{{- $username := default (randAlphaNum 10) .Values.gitlab.credentials.postgres_user }} |
109 | | -{{- if not .Values.gitlab.credentials.postgres_user }} |
110 | | -{{- $existingSecret := (lookup "v1" "Secret" .Values.gitlab.namespace $secretName) }} |
111 | | -{{- if $existingSecret }} |
112 | | -{{- $username = index $existingSecret.data "postgres_user" | b64dec }} |
113 | | -{{- end -}} |
114 | | -{{- end -}} |
115 | | -{{- print $username -}} |
116 | | -{{- end -}} |
117 | | - |
118 | | -{{- define "gitlab.postgres.password" -}} |
119 | | -{{- $secretName := (printf "%v-credentials" .Values.gitlab.app_name) -}} |
120 | | -{{- $password := default (randAlphaNum 10) .Values.gitlab.credentials.postgres_password }} |
121 | | -{{- if not .Values.gitlab.credentials.postgres_password }} |
122 | | -{{- $existingSecret := (lookup "v1" "Secret" .Values.gitlab.namespace $secretName) }} |
123 | | -{{- if $existingSecret }} |
124 | | -{{- $password = index $existingSecret.data "postgres_password" | b64dec }} |
125 | | -{{- end -}} |
126 | | -{{- end -}} |
127 | | -{{- print $password -}} |
128 | | -{{- end -}} |
129 | | - |
130 | | -{{- define "gitlab.postgres.admin_password" -}} |
131 | | -{{- $secretName := (printf "%v-credentials" .Values.gitlab.app_name) -}} |
132 | | -{{- $password := default (randAlphaNum 10) .Values.gitlab.credentials.postgres_admin_password }} |
133 | | -{{- if not .Values.gitlab.credentials.postgres_admin_password }} |
134 | | -{{- $existingSecret := (lookup "v1" "Secret" .Values.gitlab.namespace $secretName) }} |
135 | | -{{- if $existingSecret }} |
136 | | -{{- $password = index $existingSecret.data "postgres_admin_password" | b64dec }} |
137 | | -{{- end -}} |
138 | | -{{- end -}} |
139 | | -{{- print $password -}} |
140 | | -{{- end -}} |
0 commit comments