Skip to content

Commit 63a7aff

Browse files
Customizable init container image
1 parent 430e337 commit 63a7aff

File tree

5 files changed

+60
-3
lines changed

5 files changed

+60
-3
lines changed

charts/athens-proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
22
name: athens-proxy
3-
version: 0.15.3
3+
version: 0.15.4
44
appVersion: v0.16.1
55
kubeVersion: ">= 1.19-0"
66
description: The proxy server for Go modules

charts/athens-proxy/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Athens Proxy Helm Chart: athens-proxy
22

3-
![Version: 0.15.3](https://img.shields.io/badge/Version-0.15.3-informational?style=flat-square) ![AppVersion: v0.16.1](https://img.shields.io/badge/AppVersion-v0.16.1-informational?style=flat-square)
3+
![Version: 0.15.4](https://img.shields.io/badge/Version-0.15.4-informational?style=flat-square) ![AppVersion: v0.16.1](https://img.shields.io/badge/AppVersion-v0.16.1-informational?style=flat-square)
44

55
## What is Athens?
66

@@ -71,6 +71,9 @@ This will deploy a single Athens instance in the `athens` namespace with `disk`
7171
| ingress.enabled | bool | `false` | Create an Ingress resource for athens |
7272
| ingress.hosts | list | `[]` | Provide an array of values for the ingress host mapping |
7373
| ingress.tls | list | `[]` | |
74+
| initContainerImage.registry | string | `"docker.io"` | sshGitServers init container image registry |
75+
| initContainerImage.repository | string | `"alpine"` | sshGitServers init container image repository |
76+
| initContainerImage.tag | float | `3.9` | sshGitServers init container image tag |
7477
| initContainerResources | object | `{}` | sshGitServers init container resources |
7578
| initContainerSecurityContext | object | `{}` | sshGitServers init container security context configuration |
7679
| jaeger.annotations | object | `{}` | |

charts/athens-proxy/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ spec:
5252
initContainers:
5353
{{- if .Values.sshGitServers }}
5454
- name: copy-key-files
55-
image: alpine:3.9
55+
image: "{{ .Values.initContainerImage.registry }}/{{ .Values.initContainerImage.repository }}:{{ .Values.initContainerImage.tag }}"
5656
command:
5757
- sh
5858
- -c
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
templates:
2+
- deployment.yaml
3+
- config-upstream.yaml
4+
- config-ssh-git-servers.yaml
5+
- secret-ssh-git-servers.yaml
6+
7+
tests:
8+
- it: should default init container image configuration correctly
9+
template: deployment.yaml
10+
set:
11+
sshGitServers:
12+
- host: git.example.com
13+
path: "/asd"
14+
user: git
15+
privateKey: |
16+
-----BEGIN RSA PRIVATE KEY-----
17+
-----END RSA PRIVATE KEY-----
18+
port: 22
19+
asserts:
20+
- hasDocuments:
21+
count: 1
22+
- equal:
23+
path: spec.template.spec.initContainers[0].image
24+
value: "docker.io/library/alpine:3.9"
25+
26+
- it: should reflect customized init container image configuration
27+
template: deployment.yaml
28+
set:
29+
initContainerImage:
30+
registry: google.com
31+
repository: hello/world
32+
tag: 1.0.0
33+
sshGitServers:
34+
- host: git.example.com
35+
path: "/asd"
36+
user: git
37+
privateKey: |
38+
-----BEGIN RSA PRIVATE KEY-----
39+
-----END RSA PRIVATE KEY-----
40+
port: 22
41+
asserts:
42+
- hasDocuments:
43+
count: 1
44+
- equal:
45+
path: spec.template.spec.initContainers[0].image
46+
value: "google.com/hello/world:1.0.0"

charts/athens-proxy/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ sshGitServers: []
234234
# name: ssh-keys
235235
# subPath: secret.id_rsa
236236

237+
initContainerImage:
238+
# -- sshGitServers init container image registry
239+
registry: docker.io
240+
# -- sshGitServers init container image repository
241+
repository: library/alpine
242+
# -- sshGitServers init container image tag
243+
tag: 3.9
244+
237245
# -- sshGitServers init container security context configuration
238246
initContainerSecurityContext: {}
239247
# allowPrivilegeEscalation: false

0 commit comments

Comments
 (0)