feat(gateway): make resource-config ConfigMap optional and configurable - #226
Open
naresh4dev wants to merge 1 commit into
Open
naresh4dev wants to merge 1 commit into
naresh4dev wants to merge 1 commit into
Conversation
Add resourceConfig.create toggle (default: true) to allow suppressing the resource-config ConfigMap when it is already managed by another Helm release in the same namespace. This resolves ArgoCD ownership conflicts when multiple applications deploy from the same chart. Also adds: - resourceConfig.nameOverride to customize the ConfigMap name - resourceConfig.data to configure contents via values instead of editing the template directly - Proper labels on the ConfigMap for consistency with other resources
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Template compatibility and Kubernetes validation issues can prevent successful rendering or deployment.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds configurable lifecycle, naming, and data for the gateway’s shared resource ConfigMap.
Changes:
- Adds
resourceConfigvalues. - Conditionally renders the ConfigMap with labels.
- Documents PEM and multi-release configuration.
File summaries
| File | Description |
|---|---|
values.yaml |
Defines resource ConfigMap settings. |
templates/resources-config.yaml |
Renders the configurable ConfigMap. |
README.md |
Documents configuration and shared ownership. |
Review details
Suppressed comments (2)
charts/portkey-gateway/templates/resources-config.yaml:5
- Quote this value before emitting it. A valid string override such as
"123"is currently rendered asname: 123, which YAML decodes as a number and Kubernetes rejects becausemetadata.namemust be a string.
name: {{ .Values.resourceConfig.nameOverride | default "resource-config" }}
charts/portkey-gateway/templates/resources-config.yaml:9
ConfigMap.datarequires string values, buttoYamlpreserves YAML booleans, numbers, and nulls, causing Kubernetes API validation failures for otherwise natural values such asdata: { retries: 3 }. Serialize each entry withtoString | quote, matchingtemplates/gateway/config.yaml:21-22.
data:
{{- toYaml .Values.resourceConfig.data | nindent 2 }}
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -1,9 +1,10 @@ | |||
| {{- if .Values.resourceConfig.create }} | |||
| - name: shared-folder | ||
| configMap: | ||
| name: resource-config | ||
| name: resource-config # matches resourceConfig.nameOverride or default |
| # - name: shared-folder | ||
| # configMap: | ||
| # name: resource-config | ||
| # name: resource-config # matches resourceConfig.nameOverride or default name |
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.
Summary
Add
resourceConfig.createtoggle to allow suppressing theresource-configConfigMap when it is already managed by another Helm release in the same namespace. This resolves ArgoCD ownership conflicts when multiple applications deploy from the same chart into the same namespace.Problem
When two ArgoCD applications (e.g.,
gw-helm-npliveandmcpgw-helm-nplive) deploy from theportkey-gatewaychart into the same namespace, ArgoCD reports:The ConfigMap was unconditionally rendered with no option to disable it, forcing
ignoreDifferencesworkarounds in every ArgoCD ApplicationSet.Changes
values.yamlresourceConfigsection withcreate,nameOverride, anddatafieldstemplates/resources-config.yamlREADME.mdNew Values
Backward Compatibility
resourceConfig.createdefaults totrue, ConfigMap name remainsresource-config.Testing
Verified with
helm template:create: true) — ConfigMap renders with proper labelscreate: false— ConfigMap completely suppressednameOverride: custom-name— ConfigMap name overridden correctly