-
Notifications
You must be signed in to change notification settings - Fork 143
/
Copy pathgit-askpass.repo-server.jsonpatch.yaml
66 lines (60 loc) · 1.81 KB
/
git-askpass.repo-server.jsonpatch.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Author: Hari Sekhon
# Date: 2022-08-24 15:43:44 +0100 (Wed, 24 Aug 2022)
#
# vim:ts=2:sts=2:sw=2:et
# lint: k8s
#
# https://github.com/HariSekhon/Kubernetes-configs
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# A r g o C D G I T _ A S K P A S S P a t c h
# ============================================================================ #
# Useful to mount a GIT_ASKPASS script and corresponding secrets to environment variables to use in Git authentication
#
# Example use case:
#
# Kustomize Tagged Bases referencing https URLs for which the credentials are not passed through ArgoCD:
#
# https://github.com/argoproj/argo-cd/issues/9443
# Apply:
#
# run: kubectl patch deploy argocd-repo-server -n argocd --type json --patch "$(cat git-askpass.repo-server.patch.yaml)"
---
- op: add
path: /spec/template/spec/containers/0/env
value:
- name: GIT_ASKPASS
value: /usr/local/bin/git_askpass.sh
- name: GIT_USER
valueFrom:
secretKeyRef:
name: github-https-username
key: username
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
name: github-https-token
key: token
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
name: git-askpass
mountPath: /usr/local/bin/git_askpass.sh
subPath: git_askpass.sh
- op: add
path: /spec/template/spec/volumes/-
value:
name: git-askpass
configMap:
name: git-askpass
defaultMode: 0555
items:
- key: git_askpass.sh
path: git_askpass.sh