fix: handle json.Marshal error in GetIsbSvcEnvVars#3316
Closed
syayi wants to merge 2 commits intonumaproj:mainfrom
Closed
fix: handle json.Marshal error in GetIsbSvcEnvVars#3316syayi wants to merge 2 commits intonumaproj:mainfrom
syayi wants to merge 2 commits intonumaproj:mainfrom
Conversation
Previously the error from json.Marshal was silently ignored, causing encodedISBSvcConfig to be a base64-encoded "null" on failure. Use the existing MustJSON helper (consistent with MustHash/MustUnJSON patterns) which panics on error rather than silently producing a corrupted env var. Signed-off-by: Sri Harsha Yayi <sriharshayayi@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3316 +/- ##
==========================================
- Coverage 81.16% 81.15% -0.01%
==========================================
Files 316 316
Lines 72828 72827 -1
==========================================
- Hits 59108 59104 -4
- Misses 13163 13164 +1
- Partials 557 559 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
GetIsbSvcEnvVarswas silently ignoring the error fromjson.Marshal, causingencodedISBSvcConfigto be a base64-encoded"null"on failure — pods would start with a corrupted ISB config env var with no indication of the problemjson.Marshalcall with the existingMustJSONhelper, which is consistent with theMustHash/MustUnJSONpanic-on-error pattern used elsewhere in this packageencoding/jsonimportTest plan
isbs_config_test.gopass