fix: persist config directory to retain users and tokens (#6)#8
Conversation
The chart only persisted the database directory, so configured users and tokens were lost on pod restart. Add an opt-in second PVC for the config directory via persistence.config.enabled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces persistence for the ArcadeDB configuration directory by adding a new volume mount and volume claim template to the StatefulSet, along with corresponding configuration options in values.yaml and a comprehensive suite of unit tests. Feedback indicates that the ArcadeDB process must be explicitly informed of custom configuration paths via a system property in the container command to ensure the mount is utilized correctly. Additionally, it is recommended to update test assertions to avoid fragile hardcoded indices by matching volume claims by name.
| {{- end }} | ||
| {{- if .Values.persistence.config.enabled }} | ||
| - name: arcadedb-config | ||
| mountPath: {{ .Values.arcadedb.configDirectory }} |
There was a problem hiding this comment.
The mountPath is configurable via .Values.arcadedb.configDirectory, but the ArcadeDB process is not informed of this custom path in the command section. If a user overrides this value, the volume will be mounted at the new path, but the application will still look for configuration in the default /home/arcadedb/config directory. To support custom paths, the -Darcadedb.server.configurationDirectory property should be added to the container's command in templates/statefulset.yaml.
| persistence.config.size: 5Gi | ||
| asserts: | ||
| - equal: | ||
| path: spec.volumeClaimTemplates[1].spec.resources.requests.storage |
There was a problem hiding this comment.
The test assertions use hardcoded indices (e.g., spec.volumeClaimTemplates[1]) to verify the configuration PVC. This makes the tests fragile as they depend on the default state of other persistence settings (like persistence.enabled). If the default values change or if other volumes are added, these tests will fail. Consider using assertions that match by name or check the entire list for the expected object.
- contains:
path: spec.volumeClaimTemplates
content:
metadata:
name: arcadedb-config
spec:
resources:
requests:
storage: 5Gi
Summary
Fixes #6.
The chart's
persistenceblock only covered the database directory (/home/arcadedb/databases). ArcadeDB stores users, tokens, and server settings under/home/arcadedb/config, which had no PVC — so configured users and tokens were lost on pod restart while database data survived.This adds an opt-in second PVC for the config directory.
Changes
values.yaml: newarcadedb.configDirectory(default/home/arcadedb/config) andpersistence.config.{enabled,size,accessMode,storageClass}sub-section. Disabled by default to preserve existing behavior.templates/statefulset.yaml: conditionalarcadedb-configvolumeMount and VolumeClaimTemplate driven bypersistence.config.enabled.tests/statefulset_test.yaml: 8 new helm-unittest cases covering disabled-by-default, enabled rendering, size/storageClass/accessMode overrides, customconfigDirectory, VCT ordering with the data PVC, and config-only persistence.Usage
Note for upgraders
Kubernetes does not allow adding
volumeClaimTemplatesto an existing StatefulSet in place. Operators enablingpersistence.config.enabledon an existing release must delete and recreate the StatefulSet (e.g.kubectl delete sts <name> --cascade=orphanthenhelm upgrade) for the new PVC to be created.Test plan
helm unittest charts/arcadedb— 126/126 pass (57 statefulset suite + 69 others)persistence.config.enabled=true, create a user, restart the pod, verify the user survives🤖 Generated with Claude Code