fix(config): handle numeric, boolean, and falsy env var values#169
Open
camjay wants to merge 2 commits intoPortkey-AI:mainfrom
Open
fix(config): handle numeric, boolean, and falsy env var values#169camjay wants to merge 2 commits intoPortkey-AI:mainfrom
camjay wants to merge 2 commits intoPortkey-AI:mainfrom
Conversation
8dfc67b to
533ce2f
Compare
Numeric and boolean values in environment.data (e.g., PORT: 8787, REDIS_TLS_ENABLED: false) fail b64enc in Secret mode and render as unquoted YAML in ConfigMap mode. Fixes: - Add toString before b64enc (Secret) and toString|quote (ConfigMap) - Change the if guard from `if $val` to `if not (kindIs "invalid" $val)` so that falsy values (false, 0, "") are properly encoded instead of being treated as empty
533ce2f to
ff3c1f3
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the portkey-gateway Helm chart environment resource template to correctly render numeric/boolean and falsy values in both Secret and ConfigMap modes, avoiding template failures and YAML type surprises.
Changes:
- Convert env var values to strings before base64 encoding when rendering a Secret.
- Quote ConfigMap values after converting to strings to ensure they are always YAML strings.
- Replace the
if $valguard with an invalid-kind check sofalse,0, and""are preserved.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
sk-portkey
approved these changes
Mar 27, 2026
Contributor
|
LGTM |
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.
Numeric and boolean values in
environment.data(e.g.,PORT: 8787,REDIS_TLS_ENABLED: false) failb64encin Secret mode and render as unquoted YAML in ConfigMap mode.Additionally, the existing
{{- if $val }}guard treatsfalse,0, and""as falsy — encoding them as empty strings instead of their actual values.Fixes:
toStringbeforeb64enc(Secret) andtoString | quote(ConfigMap)if $valtoif not (kindIs "invalid" $val)so falsy values are properly encodedSee also #173 which adds CI to validate chart templates on PRs.