-
Notifications
You must be signed in to change notification settings - Fork 112
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
feat: Add support for extra objects #136
base: main
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@sebastiansterk has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 27 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis pull request updates the n8n Helm chart by adding new documentation and templating support for deploying additional Kubernetes objects. A warning and a new “Extra objects” section with an example have been added to the README. In parallel, a new configuration option ( Changes
Sequence Diagram(s)sequenceDiagram
participant U as User Values Input
participant H as Helm Templating Engine
participant R as n8n.render Helper
participant K as Kubernetes API
U->>H: Provide extraObjects in values.yaml
H->>R: Invoke n8n.render for each extra object
R-->>H: Return rendered YAML object
H->>K: Deploy generated Kubernetes objects
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
charts/n8n/templates/tests/extra.yaml (1)
1-14
: Enhance test coverage with more examples.While the current examples demonstrate basic usage, consider adding:
- A Secret example to demonstrate sensitive data handling
- An example with more complex templating
- An example using nested objects
Also, add a newline at the end of the file to fix the YAML lint warning.
name: "templated" data: - something: {{ printf "templated" }} + something: {{ printf "templated" }} +🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 14-14: no new line character at the end of file
(new-line-at-end-of-file)
charts/n8n/values.yaml (1)
335-338
: Enhance documentation with inline example.While the description references the test example, it would be helpful to include a commented example directly in the values file.
Add an inline example:
# Example can be found in charts/n8n/templates/tests/extra.yaml extraObjects: [] +# Example: +# extraObjects: +# - apiVersion: v1 +# kind: ConfigMap +# metadata: +# name: example-config +# data: +# key: valueREADME.md (2)
316-318
: Clarify the new "Extra Objects" feature documentation.
The new section clearly outlines how to add additional Kubernetes resources via theextraObjects
section invalues.yaml
. For enhanced clarity, consider including a brief note on supported resource types and any limitations or prerequisites (for example, if there are any encoding requirements for Secret data).
319-335
: Verify accuracy of the YAML snippet for Kubernetes Secrets.
The example YAML snippet properly demonstrates adding extra objects. However, note that Kubernetes expects Secret data to be base64 encoded when provided under thedata
field. If the intention is to allow plain text values, consider usingstringData
or add an inline comment explaining the expected format.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
README.md
(1 hunks)charts/n8n/templates/_helpers.tpl
(1 hunks)charts/n8n/templates/extra.objects.yaml
(1 hunks)charts/n8n/templates/tests/extra.yaml
(1 hunks)charts/n8n/values.yaml
(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
charts/n8n/templates/extra.objects.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
charts/n8n/templates/tests/extra.yaml
[error] 14-14: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (1)
charts/n8n/templates/extra.objects.yaml (1)
1-4
: LGTM! Clean and efficient implementation.The implementation correctly:
- Iterates over extraObjects
- Separates each object with YAML document separator
- Passes required context to the render function
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
charts/n8n/templates/_helpers.tpl (1)
143-144
: Add comprehensive documentation.The current comment lacks important details. Consider adding:
- Parameter descriptions
- Return value description
- Usage examples
- Security considerations
Add this documentation:
{{/* -Renders a complete tree, even values that contains template. +Renders a complete tree of values, supporting both string and non-string values that contain templates. + +Parameters: + - value: The value to render. Can be a string containing templates or a complex object. + - context: The context object containing variables for template rendering. + +Returns: + The rendered value as a string. + +Example: + {{- $value := dict "name" "{{ .Release.Name }}-config" "data" (dict "key" "value") -}} + {{- include "n8n.render" (dict "value" $value "context" .) -}} + +Security Note: + This function executes templates with full access to the context. + Ensure that the input values are trusted and properly validated. */}}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
charts/n8n/templates/_helpers.tpl
(1 hunks)
🔇 Additional comments (1)
charts/n8n/templates/_helpers.tpl (1)
145-150
: LGTM! Input validation implemented as suggested.The validation for empty values and context has been implemented as suggested in the past review comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am primary focusing on the next (there is branch with that name) release.
Take a look into it, and see if a PR against that branch makes sense.
Extra objects are already supported. If you didn't spot it, then we need to update the docs to make it more clear. Happy to get
Second opinion on this.
Even if Next is not yet released as webhooks and workers are missing, it is already in prod and working as expected.
Extra objects
You can add extra objects to the deployment, like configmaps, secrets, etc. by adding them to the
extraObjects
section in thevalues.yaml
file so no additional deployment/pipeline is needed.Example:
This is not limited to configmaps or secrets, but supports all resources/kinds within your k8s cluster.
Summary by CodeRabbit