Fix Neo4j backup/restore runAsUser and Neo4j RestoreSession shape - #1137
Merged
Conversation
Neo4j runs as uid 7474, not 999, so the BackupConfiguration built by the neo4j editor used the wrong security context. For restore, move the per-kind runAsUser out of the wizard JS into a chart helper carrying the same defaults as container.securityContext of each kubedbcom-<db>-editor-options chart. The JS map covered only 9 kinds, so every other kind (Neo4j included) rendered no securityContext at all. The OpenShift uid-range annotation still overrides it. A Neo4j restore also needs the target's data PVC mounted at /data and the seedServerName task parameter, both derived from the target name. Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
Matches what the restore wizard used before this branch. Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Neo4j BackupConfiguration
runAsUserwas 999 in both security contexts built by the neo4j editor; Neo4j runs as 7474.RestoreSession runAsUser
The uid lived in a 9-entry map in
corekubestashcom-restoresession-editor-options/ui/functions.js,which was out of sync with the real per-DB defaults in each
kubedbcom-<db>-editor-optionscontainer.securityContexthelper. For any kind missing from that map — Neo4j, Cassandra, Kafka,Solr, ClickHouse, DB2, … —
spec.addon.jobTemplate.securityContextstayed empty and the wholejobTemplate+containerRuntimeSettingsblock was dropped from the rendered RestoreSession.The default now comes from a chart helper mirroring those 29 charts; the JS only supplies the
OpenShift
sa.scc.uid-rangeoverride. RabbitMQ is intentionally absent — its options chart has nocontainer.securityContexthelper, so it keeps today's behaviour.One correction this brings along: ZooKeeper 999 → 1000, matching its options chart. Postgres stays
at 70 as before, even though
kubedbcom-postgres-editor-options/templates/_helpers.tpldefaults to999 outside
timescaledb-*and oldN.Mversions.Neo4j RestoreSession shape
For
kind: Neo4jthe restore job now also gets the target's data PVC and the seed pod parameter,both derived from
spec.target.name:setNeo4jParams()fills the parameter in oninitMetadataand on target-name change; it stayseditable in the "Additional Parameters" textarea.
Verified
helm templateofcorekubestashcom-restoresession-editor-options:kind=Neo4j→ volume/mount,runAsUser: 7474,paramsas a YAML flow mapkind=MongoDB→ 999, no volumesspec.addon.jobTemplate.securityContextstill winskind=RabbitMQand empty target → nojobTemplateblock, as beforego build ./...andhelm lintclean.