-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mirrorbits-lite) allow overriding ingress and PV(C)s based on gl…
…obal value from parent chart chore(mirrorbits-lite) increase unit test coverage to PV and PVC with their volumeMounts Signed-off-by: Damien Duportal <[email protected]>
- Loading branch information
Showing
11 changed files
with
229 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
apiVersion: v1 | ||
description: Mirrobits lite helm chart for Kubernetes | ||
name: mirrorbits-lite | ||
version: 0.2.1 | ||
version: 0.3.0 | ||
appVersion: "v0.5.1" | ||
maintainers: | ||
- email: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
description: Mock Parent Chart Helpers | ||
name: mock | ||
version: 0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{/* | ||
Mock parent chart helper template | ||
*/}} | ||
{{- define "parent.data-volume" -}} | ||
parent-chart-shared-data | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{{ if $.Values.repository.persistentVolume.enabled -}} | ||
{{ if and .Values.repository.persistentVolume.enabled (not (dig "global" "ingress" "enabled" false .Values.AsMap)) -}} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: {{ $.Values.repository.name | default (printf "%s-binary" (include "mirrorbits-lite.fullname" .)) }} | ||
name: {{ .Values.repository.name | default (printf "%s-binary" (include "mirrorbits-lite.fullname" .)) }} | ||
labels: | ||
data: {{ $.Values.repository.name | default (printf "%s-binary" (include "mirrorbits-lite.fullname" . )) }} | ||
data: {{ .Values.repository.name | default (printf "%s-binary" (include "mirrorbits-lite.fullname" . )) }} | ||
spec: | ||
{{ toYaml .Values.repository.persistentVolume.spec | nindent 2 }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{{ if $.Values.repository.persistentVolumeClaim.enabled -}} | ||
{{ if and .Values.repository.persistentVolumeClaim.enabled (not (dig "global" "ingress" "enabled" false .Values.AsMap)) -}} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ $.Values.repository.name | default (printf "%s-binary" (include "mirrorbits-lite.fullname" .)) }} | ||
name: {{ .Values.repository.name | default (printf "%s-binary" (include "mirrorbits-lite.fullname" .)) }} | ||
spec: | ||
{{ toYaml $.Values.repository.persistentVolumeClaim.spec | nindent 2 }} | ||
{{ toYaml .Values.repository.persistentVolumeClaim.spec | nindent 2 }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
suite: Tests with values from parent (umbrella ingress and umbrella PVC) | ||
templates: | ||
- templates/deployment.yaml | ||
- templates/ingress.yaml | ||
- templates/secret.yaml # Direct dependency of deployment(.*).yaml | ||
- templates/persistentVolume.yaml | ||
- templates/persistentVolumeClaim.yaml | ||
set: | ||
# Mock chart parent inherited global values passed to subcharts | ||
global: | ||
storage: | ||
enabled: true | ||
ingress: | ||
enabled: true | ||
# Try to specify a ingress which must be ignored (parent prevails) | ||
ingress: | ||
enabled: true | ||
hosts: | ||
- host: chart-example.local | ||
paths: | ||
- path: / | ||
pathType: IfNotPresent | ||
# Try to specify a PV which must be ignored (parent prevails) | ||
repository: | ||
name: mirrorbits-binary | ||
persistentVolumeClaim: | ||
enabled: true | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
storageClassName: azurefile-csi-premium | ||
resources: | ||
requests: | ||
storage: 1000Gi | ||
volumeName: mirrorbits-binary | ||
persistentVolume: | ||
enabled: true | ||
spec: | ||
capacity: | ||
storage: 1000Gi | ||
storageClassName: azurefile-csi-premium | ||
accessModes: | ||
- ReadWriteMany | ||
persistentVolumeReclaimPolicy: Retain | ||
csi: | ||
driver: file.csi.azure.com | ||
readOnly: false | ||
volumeHandle: mirrorbits-binary # make sure this volumeid is unique for every identical share in the cluster | ||
volumeAttributes: | ||
resourceGroup: prod-core-releases | ||
shareName: mirrorbits | ||
nodeStageSecretRef: | ||
name: mirrorbits-binary | ||
namespace: mirrorbits | ||
mountOptions: | ||
- dir_mode=0755 | ||
tests: | ||
- it: should define a customized "mirrorbits-lite" deployment | ||
template: deployment.yaml | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- isKind: | ||
of: Deployment | ||
# Data Volume (references a claim from parent chart) | ||
- equal: | ||
path: spec.template.spec.volumes[3].name | ||
value: data | ||
- equal: | ||
path: spec.template.spec.volumes[3].persistentVolumeClaim.claimName | ||
value: parent-chart-shared-data | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[3].name | ||
value: data | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[3].mountPath | ||
value: /srv/repo | ||
- it: should not create any ingress | ||
template: ingress.yaml | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: should not define any persistent volume | ||
template: persistentVolume.yaml | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: should not define any PV claim | ||
template: persistentVolumeClaim.yaml | ||
asserts: | ||
- hasDocuments: | ||
count: 0 |