Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve namespacing of templates to prevent conflicts between charts #343

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

bluepichu
Copy link

Currently, some templates are defined in multiple charts under the same name, but with different implementations. Sometimes these implementations are completely incompatible, such as the neo4j.nodeSelector template being incompatible between the neo4j and neo4j-admin charts.

This is a problem because it is often desirable to maintain these charts together as subcharts of a common parent chart. For example, I'm trying to use this Chart.yaml alongside an appropriate values.yaml to manage a database and its associated backup infrastructure in a single chart as part of a larger application:

apiVersion: v3
appVersion: "0.1.0"
description:
name: my-neo4j-app
version: 0.1.0
dependencies:
  - name: neo4j
    repository: https://helm.neo4j.com/neo4j
    version: 5.20.0
  - name: neo4j-admin
    alias: neo4j-backup
    repository: https://helm.neo4j.com/neo4j
    version: 5.20.0
    condition: backup.enabled

This currently errors out due to the conflicting definitions of some templates.

The solution used here is to namespace all of the templates by the specific chart that they are a part of rather than by simply neo4j. For example, the fullname template in neo4j-admin is renamed from neo4j.fullname to neo4jAdmin.fullname to prevent a potential conflict with the main neo4j chart. The actual method of doing this was just a find-replace of (?<=define |template )"neo4j.([^"]*)" for "<chartname>.$1" within each chart.

A note on testing: I only tested this so far as making sure it worked for my neo4j + neo4j-admin setup. I couldn't figure out how to run the tests locally, but I'm assuming they should run on this PR and catch any cases I might have missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant