Skip to content

Commit 499973e

Browse files
fix: volume-provisioner with azure disks (#417)
1 parent 4ec93dd commit 499973e

File tree

5 files changed

+63
-7
lines changed

5 files changed

+63
-7
lines changed

charts/cf-runtime/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: A Helm chart for Codefresh Runner
33
name: cf-runtime
4-
version: 6.2.3
4+
version: 6.2.4
55
keywords:
66
- codefresh
77
- runner
@@ -14,8 +14,8 @@ maintainers:
1414
url: https://codefresh-io.github.io/
1515
annotations:
1616
artifacthub.io/changes: |
17-
- kind: security
18-
description: Fix security vulnerabilities in dind image
17+
- kind: fixed
18+
description: Fix volume-provisioner for Azure Disks
1919
dependencies:
2020
- name: cf-common
2121
repository: oci://quay.io/codefresh/charts

charts/cf-runtime/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Codefresh Runner
22

3-
![Version: 6.2.3](https://img.shields.io/badge/Version-6.2.3-informational?style=flat-square)
3+
![Version: 6.2.4](https://img.shields.io/badge/Version-6.2.4-informational?style=flat-square)
44

55
Helm chart for deploying [Codefresh Runner](https://codefresh.io/docs/docs/installation/codefresh-runner/) to Kubernetes.
66

charts/cf-runtime/templates/_components/volume-provisioner/_env-vars.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ AWS_SECRET_ACCESS_KEY:
3737
GOOGLE_APPLICATION_CREDENTIALS: /etc/dind-volume-provisioner/credentials/google-service-account.json
3838
{{- end }}
3939

40-
{{- if and .Values.mountAzureJson }}
40+
{{- if and .Values.storage.mountAzureJson }}
4141
AZURE_CREDENTIAL_FILE: /etc/kubernetes/azure.json
42+
CLOUDCONFIG_AZURE: /etc/kubernetes/azure.json
4243
{{- end }}
4344

4445
{{- end }}
@@ -65,7 +66,7 @@ AZURE_CREDENTIAL_FILE: /etc/kubernetes/azure.json
6566
secretName: {{ .Values.storage.gcedisk.serviceAccountJsonSecretKeyRef.name }}
6667
optional: true
6768
{{- end }}
68-
{{- if .Values.mountAzureJson }}
69+
{{- if .Values.storage.mountAzureJson }}
6970
- name: azure-json
7071
hostPath:
7172
path: /etc/kubernetes/azure.json
@@ -79,7 +80,7 @@ AZURE_CREDENTIAL_FILE: /etc/kubernetes/azure.json
7980
readOnly: true
8081
mountPath: "/etc/dind-volume-provisioner/credentials"
8182
{{- end }}
82-
{{- if .Values.mountAzureJson }}
83+
{{- if .Values.storage.mountAzureJson }}
8384
- name: azure-json
8485
readOnly: true
8586
mountPath: "/etc/kubernetes/azure.json"

charts/cf-runtime/templates/volume-provisioner/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{- $volumeProvisionerContext := deepCopy . }}
22
{{- $_ := set $volumeProvisionerContext "Values" (get .Values "volumeProvisioner") }}
33
{{- $_ := set $volumeProvisionerContext.Values "global" (get .Values "global") }}
4+
{{- $_ := set $volumeProvisionerContext.Values "storage" (get .Values "storage") }}
45

56
{{- if $volumeProvisionerContext.Values.enabled }}
67
{{- include "dind-volume-provisioner.resources.deployment" $volumeProvisionerContext }}

charts/cf-runtime/tests/volume-provisioner/volume-provisioner_test.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,57 @@ tests:
358358
- hasDocuments:
359359
count: 0
360360
template: templates/volume-provisioner/storageclass.yaml
361+
362+
- it: Test volume-provisioner with azure disks
363+
set:
364+
storage.backend: azuredisk
365+
storage.azuredisk.location: somewhere
366+
storage.azuredisk.resourceGroup: some-rg
367+
storage.mountAzureJson: true
368+
asserts:
369+
- contains:
370+
path: spec.template.spec.containers[0].env
371+
content:
372+
name: AZURE_CREDENTIAL_FILE
373+
value: /etc/kubernetes/azure.json
374+
template: templates/volume-provisioner/deployment.yaml
375+
- contains:
376+
path: spec.template.spec.containers[0].env
377+
content:
378+
name: CLOUDCONFIG_AZURE
379+
value: /etc/kubernetes/azure.json
380+
template: templates/volume-provisioner/deployment.yaml
381+
- contains:
382+
path: spec.template.spec.containers[0].volumeMounts
383+
count: 1
384+
any: true
385+
content:
386+
name: azure-json
387+
readOnly: true
388+
mountPath: "/etc/kubernetes/azure.json"
389+
template: templates/volume-provisioner/deployment.yaml
390+
- contains:
391+
path: spec.template.spec.volumes
392+
count: 1
393+
any: true
394+
content:
395+
name: azure-json
396+
hostPath:
397+
path: /etc/kubernetes/azure.json
398+
type: File
399+
template: templates/volume-provisioner/deployment.yaml
400+
- hasDocuments:
401+
count: 0
402+
template: templates/volume-provisioner/secret.yaml
403+
- equal:
404+
path: parameters.volumeBackend
405+
value: azuredisk
406+
template: templates/volume-provisioner/storageclass.yaml
407+
- equal:
408+
path: parameters.location
409+
value: somewhere
410+
template: templates/volume-provisioner/storageclass.yaml
411+
- equal:
412+
path: parameters.resourceGroup
413+
value: some-rg
414+
template: templates/volume-provisioner/storageclass.yaml

0 commit comments

Comments
 (0)