Skip to content

fix: handle json.Marshal error in GetIsbSvcEnvVars#3316

Closed
syayi wants to merge 2 commits intonumaproj:mainfrom
syayi:fix/isbs-config-marshal-error
Closed

fix: handle json.Marshal error in GetIsbSvcEnvVars#3316
syayi wants to merge 2 commits intonumaproj:mainfrom
syayi:fix/isbs-config-marshal-error

Conversation

@syayi
Copy link
Member

@syayi syayi commented Mar 16, 2026

Summary

  • GetIsbSvcEnvVars was silently ignoring the error from json.Marshal, causing encodedISBSvcConfig to be a base64-encoded "null" on failure — pods would start with a corrupted ISB config env var with no indication of the problem
  • Replaced the inline json.Marshal call with the existing MustJSON helper, which is consistent with the MustHash/MustUnJSON panic-on-error pattern used elsewhere in this package
  • Also removes the now-unused encoding/json import

Test plan

  • Existing unit tests in isbs_config_test.go pass

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>
@syayi syayi requested review from vigith, whynowy and yhl25 as code owners March 16, 2026 15:26
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.15%. Comparing base (ab8e64c) to head (7429051).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@syayi syayi closed this Mar 17, 2026
@syayi syayi deleted the fix/isbs-config-marshal-error branch March 17, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant