Skip to content

Commit 01f4fec

Browse files
committed
update chart structure
1 parent 8a9750a commit 01f4fec

11 files changed

Lines changed: 526 additions & 579 deletions

charts/marmot/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: marmot
33
description: Marmot is an open-source data catalog that helps teams discover, understand, and govern their data assets. It's designed for modern data ecosystems where data flows through multiple systems, formats, and teams.
44
type: application
5-
version: 0.8.0
6-
appVersion: "0.7.0"
5+
version: 1.0.0
6+
appVersion: "0.8.0"
77
icon: https://marmotdata.github.io/charts/marmot.png
88
home: https://github.com/marmotdata/marmot
99
sources:

charts/marmot/templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To access Marmot:
2222

2323
Default credentials: admin / admin
2424

25-
{{- if and (not .Values.config.server.encryptionKey) (not .Values.config.server.encryptionKeySecretRef) .Values.config.server.autoGenerateEncryptionKey }}
25+
{{- if and (not .Values.config.server.encryptionKeySecretRef) .Values.config.server.autoGenerateEncryptionKey }}
2626

2727
═══════════════════════════════════════════════════════════════
2828
⚠️ ENCRYPTION KEY AUTO-GENERATED
@@ -47,7 +47,7 @@ The secret will persist even if you uninstall this release.
4747
═══════════════════════════════════════════════════════════════
4848
{{- end }}
4949

50-
{{- if .Values.config.server.allowUnencrypted }}
50+
{{- if .Values.config.server.allow_unencrypted }}
5151

5252
═══════════════════════════════════════════════════════════════
5353
⚠️ WARNING: ENCRYPTION DISABLED
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "marmot.fullname" . }}-config
5+
labels:
6+
{{- include "marmot.labels" . | nindent 4 }}
7+
data:
8+
config.yaml: |
9+
{{- $config := deepCopy .Values.config }}
10+
{{- /* Strip secrets and Helm-only keys */}}
11+
{{- $_ := unset $config.server "encryptionKeySecretRef" }}
12+
{{- $_ := unset $config.server "autoGenerateEncryptionKey" }}
13+
{{- $_ := unset $config.database "passwordSecretRef" }}
14+
{{- if and (hasKey $config "search") (hasKey $config.search "elasticsearch") }}
15+
{{- $_ := unset $config.search.elasticsearch "passwordSecretRef" }}
16+
{{- end }}
17+
{{- range $name := list "okta" "google" "github" "gitlab" "keycloak" "slack" "auth0" "generic_oidc" }}
18+
{{- if hasKey $config.auth $name }}
19+
{{- $_ := unset (index $config.auth $name) "clientSecretRef" }}
20+
{{- end }}
21+
{{- end }}
22+
{{- toYaml $config | nindent 4 }}

charts/marmot/templates/deployment.yaml

Lines changed: 54 additions & 349 deletions
Large diffs are not rendered by default.

charts/marmot/templates/encryption-key-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and (not .Values.config.server.encryptionKey) (not .Values.config.server.encryptionKeySecretRef) .Values.config.server.autoGenerateEncryptionKey }}
1+
{{- if and (not .Values.config.server.encryptionKeySecretRef) .Values.config.server.autoGenerateEncryptionKey }}
22
apiVersion: batch/v1
33
kind: Job
44
metadata:

charts/marmot/templates/role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and (not .Values.config.server.encryptionKey) (not .Values.config.server.encryptionKeySecretRef) .Values.config.server.autoGenerateEncryptionKey }}
1+
{{- if and (not .Values.config.server.encryptionKeySecretRef) .Values.config.server.autoGenerateEncryptionKey }}
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: Role
44
metadata:

charts/marmot/templates/rolebinding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and (not .Values.config.server.encryptionKey) (not .Values.config.server.encryptionKeySecretRef) .Values.config.server.autoGenerateEncryptionKey }}
1+
{{- if and (not .Values.config.server.encryptionKeySecretRef) .Values.config.server.autoGenerateEncryptionKey }}
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: RoleBinding
44
metadata:
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
suite: test configmap
2+
templates:
3+
- configmap.yaml
4+
tests:
5+
- it: should render a ConfigMap
6+
asserts:
7+
- isKind:
8+
of: ConfigMap
9+
- equal:
10+
path: metadata.name
11+
value: RELEASE-NAME-marmot-config
12+
13+
- it: should include config.yaml data key
14+
asserts:
15+
- isNotNull:
16+
path: data["config.yaml"]
17+
18+
- it: should include default server config
19+
asserts:
20+
- matchRegex:
21+
path: data["config.yaml"]
22+
pattern: "port: 8080"
23+
- matchRegex:
24+
path: data["config.yaml"]
25+
pattern: "host: 0\\.0\\.0\\.0"
26+
27+
- it: should include default logging config
28+
asserts:
29+
- matchRegex:
30+
path: data["config.yaml"]
31+
pattern: "level: info"
32+
- matchRegex:
33+
path: data["config.yaml"]
34+
pattern: "format: json"
35+
36+
- it: should include default database config
37+
asserts:
38+
- matchRegex:
39+
path: data["config.yaml"]
40+
pattern: "host: postgresql"
41+
- matchRegex:
42+
path: data["config.yaml"]
43+
pattern: "sslmode: disable"
44+
45+
- it: should NOT include Helm-only keys in ConfigMap
46+
asserts:
47+
- notMatchRegex:
48+
path: data["config.yaml"]
49+
pattern: "encryptionKeySecretRef"
50+
- notMatchRegex:
51+
path: data["config.yaml"]
52+
pattern: "autoGenerateEncryptionKey"
53+
- notMatchRegex:
54+
path: data["config.yaml"]
55+
pattern: "passwordSecretRef"
56+
- notMatchRegex:
57+
path: data["config.yaml"]
58+
pattern: "clientSecretRef"
59+
60+
- it: should always use raw config.database values (subchart overrides are env vars)
61+
set:
62+
postgresql.enabled: true
63+
postgresql.auth.username: "testuser"
64+
postgresql.auth.database: "testdb"
65+
asserts:
66+
- matchRegex:
67+
path: data["config.yaml"]
68+
pattern: "host: postgresql"
69+
- matchRegex:
70+
path: data["config.yaml"]
71+
pattern: "user: marmot"
72+
73+
- it: should include auth provider config without clientSecretRef
74+
set:
75+
config.auth.okta:
76+
enabled: true
77+
client_id: "my-client-id"
78+
clientSecretRef:
79+
name: "okta-secret"
80+
key: "client-secret"
81+
url: "https://test.okta.com"
82+
asserts:
83+
- matchRegex:
84+
path: data["config.yaml"]
85+
pattern: "client_id: my-client-id"
86+
- notMatchRegex:
87+
path: data["config.yaml"]
88+
pattern: "clientSecretRef"
89+
- notMatchRegex:
90+
path: data["config.yaml"]
91+
pattern: "okta-secret"
92+
93+
- it: should strip elasticsearch passwordSecretRef from ConfigMap
94+
set:
95+
config.search.elasticsearch:
96+
enabled: true
97+
addresses:
98+
- "http://elasticsearch:9200"
99+
username: "elastic"
100+
passwordSecretRef:
101+
name: "es-secret"
102+
key: "password"
103+
index: "marmot"
104+
asserts:
105+
- matchRegex:
106+
path: data["config.yaml"]
107+
pattern: "username: elastic"
108+
- notMatchRegex:
109+
path: data["config.yaml"]
110+
pattern: "passwordSecretRef"
111+
- notMatchRegex:
112+
path: data["config.yaml"]
113+
pattern: "es-secret"
114+
115+
- it: should include pipelines config
116+
asserts:
117+
- matchRegex:
118+
path: data["config.yaml"]
119+
pattern: "max_workers: 10"
120+
- matchRegex:
121+
path: data["config.yaml"]
122+
pattern: "scheduler_interval: 60"

0 commit comments

Comments
 (0)