fix(helm): support omitting image.registry in grafana-mcp chart#2125
Merged
EItanya merged 1 commit intoJul 1, 2026
Merged
Conversation
Signed-off-by: Mike Spinks <mikespinks@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the helm/tools/grafana-mcp Helm chart to render a valid container image reference when image.registry is explicitly set to an empty string, preventing invalid leading-slash image values that cause ImagePullBackOff.
Changes:
- Introduced a
grafana-mcp.imagehelper that builds the image path by joining only non-empty segments and appending the tag. - Updated the Deployment template to use the new helper for the container image field.
- Added Helm unittest cases to guard the default image value and verify the empty-registry behavior (including a no-leading-slash check).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| helm/tools/grafana-mcp/templates/_helpers.tpl | Adds grafana-mcp.image helper to compose image references without empty path segments. |
| helm/tools/grafana-mcp/templates/deployment.yaml | Switches the Deployment container image field to use the new helper. |
| helm/tools/grafana-mcp/tests/deployment_test.yaml | Adds regression + empty-registry Helm unittest assertions for the rendered image field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
EItanya
approved these changes
Jul 1, 2026
4 tasks
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.
What
Make the grafana-mcp chart render a valid image reference when
image.registryis left empty, so the registry can be omitted (e.g. to pull from a mirror or let the runtime resolve the default registry) without producing a leading-slash, unpullable reference.Why
The image is built inline in
templates/deployment.yaml:The
/between registry and repository is written unconditionally. Ifimage.registryis set to"", the result has a leading slash and is not a valid image reference, so the pod entersImagePullBackOff:There is currently no way to omit the registry and let the container runtime resolve the repository against its default registry / a configured mirror.
Omitting the registry is a configuration users legitimately need:
repository:tag.registry: "".ImagePullBackOff, which reads like a bug.Fix
Introduce a
grafana-mcp.imagehelper (the chart currently has none) that builds the path from non-empty segments viacompact+join, and call it from the deployment:Rendered results:
mcpgrafanalatestmcp/grafana:latest(unchanged)""grafanalatestgrafana:latest(fixed)Tests
Added two cases to
helm/tools/grafana-mcp/tests/deployment_test.yaml(developed test-first): a default-image regression guard (the suite had no image assertion), and the empty-registry path.The empty-registry test fails without this change (
/grafana:latest) and passes with it — revert thedeployment.yaml/_helpers.tplhunks to reproduce.How to verify
Scope
Limited to the grafana-mcp chart's image construction. Empty
repositoryis not made valid here — omitting it leaves no image to pull. This PR only makesimage.registryoptional.Checklist
git commit -s).helm unittest helm/tools/grafana-mcpgreen;helm lint helm/tools/grafana-mcpclean.mcp/grafana:latest(regression guard).templates/_helpers.tpl,templates/deployment.yaml, andtests/deployment_test.yaml(generated chart files excluded).