diff --git a/charts/eurofurence-registration-system/Chart.yaml b/charts/eurofurence-registration-system/Chart.yaml index 99c40a2..4c9d52c 100644 --- a/charts/eurofurence-registration-system/Chart.yaml +++ b/charts/eurofurence-registration-system/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: eurofurence-registration-system -version: 0.0.1 +version: 0.0.2 description: A helm chart that can deploy the Eurofurence Registration System. type: application home: https://github.com/eurofurence/reg-helm-chart diff --git a/charts/eurofurence-registration-system/templates/namespace.yaml b/charts/eurofurence-registration-system/templates/namespace.yaml new file mode 100644 index 0000000..5433b8f --- /dev/null +++ b/charts/eurofurence-registration-system/templates/namespace.yaml @@ -0,0 +1,9 @@ +{{- if (.Values.namespace).create }} +apiVersion: v1 +kind: Namespace +metadata: + name: '{{ .Values.global.namespace }}' + annotations: + argocd.argoproj.io/sync-wave: "-10" +--- +{{ end }} diff --git a/charts/eurofurence-registration-system/tests/namespace_test.yaml b/charts/eurofurence-registration-system/tests/namespace_test.yaml new file mode 100644 index 0000000..b31c1d3 --- /dev/null +++ b/charts/eurofurence-registration-system/tests/namespace_test.yaml @@ -0,0 +1,26 @@ +suite: test ingress +templates: + - namespace.yaml +tests: + - it: should not create anything by default + asserts: + - hasDocuments: + count: 0 + - it: should create a namespace if enabled + set: + global: + namespace: hellospace + namespace: + create: true + asserts: + - isKind: + of: Namespace + - hasDocuments: + count: 1 + - equal: + path: metadata + value: + name: hellospace + annotations: + argocd.argoproj.io/sync-wave: "-10" + diff --git a/charts/eurofurence-registration-system/values-example.yaml b/charts/eurofurence-registration-system/values-example.yaml index a01fdc2..1fbfc9e 100644 --- a/charts/eurofurence-registration-system/values-example.yaml +++ b/charts/eurofurence-registration-system/values-example.yaml @@ -13,6 +13,9 @@ global: namespace: my-namespace +namespace: + create: true + ingress: enable: true diff --git a/charts/eurofurence-registration-system/values.schema.json b/charts/eurofurence-registration-system/values.schema.json index 44a630b..940e43f 100644 --- a/charts/eurofurence-registration-system/values.schema.json +++ b/charts/eurofurence-registration-system/values.schema.json @@ -17,6 +17,18 @@ } } }, + "namespace": { + "additionalProperties": false, + "type": "object", + "description": "settings for an ingress (optional, off by default)", + "properties": { + "create": { + "type": "boolean", + "description": "enable creating the namespace", + "default": false + } + } + }, "ingress": { "additionalProperties": false, "type": "object",