Fix: gracefully handle missing optional env vars for Helm/Kubernetes (#186)#196
Open
AnthonyGeorgeAZ wants to merge 4 commits into
Open
Fix: gracefully handle missing optional env vars for Helm/Kubernetes (#186)#196AnthonyGeorgeAZ wants to merge 4 commits into
AnthonyGeorgeAZ wants to merge 4 commits into
Conversation
…optional env vars gracefully in getRuntimeValue (Grashjs#186) Trim envValue and treat empty string, "-" and "disabled" as undefined so absent Helm/Kubernetes env vars don't cause crashes or subtle bugs.
Explains to Helm/Kubernetes operators that optional variables should be omitted rather than set to empty strings, and warns against using "-" as a sentinel value.
👷 Deploy request for atlasjs-home pending review.Visit the deploys page to approve it
|
👷 Deploy request for atlas-cmms pending review.Visit the deploys page to approve it
|
…defined (Grashjs#186) getRuntimeValue can now return undefined for absent vars. Fixed two exported constants typed as string that were not handling the undefined case.
…shjs#186) INVITATION_VIA_EMAIL, ENABLE_EMAIL_NOTIFICATIONS and OAUTH2_PROVIDER had no defaults, causing Spring Boot to fail on startup when deployed via Helm/Kubernetes where empty env vars are stripped entirely.
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.
Problem
When using Helm to deploy, optional env vars set to empty strings in values.yaml get stripped by Kubernetes so the container never sees them. This caused two issues:
Changes
frontend/src/config.ts—getRuntimeValuenow trims values and treats empty strings,"-"and"disabled"as not configuredREADME.MD— added a note for Helm/Kubernetes operators explaining to omit optional vars rather than set them to empty stringsTesting
""in Helm → app starts normally"-"→ treated as not configuredFixes #186