Skip to content

Commit

Permalink
feat(#3): create namespace option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Dec 13, 2023
1 parent ab24db4 commit 4971519
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/eurofurence-registration-system/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 }}
26 changes: 26 additions & 0 deletions charts/eurofurence-registration-system/tests/namespace_test.yaml
Original file line number Diff line number Diff line change
@@ -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"

3 changes: 3 additions & 0 deletions charts/eurofurence-registration-system/values-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
global:
namespace: my-namespace

namespace:
create: true

ingress:
enable: true

Expand Down
12 changes: 12 additions & 0 deletions charts/eurofurence-registration-system/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4971519

Please sign in to comment.