Fix panic in determineMaxBodySize on empty proxy-body-size annotation - #465
Fix panic in determineMaxBodySize on empty proxy-body-size annotation#465apvxlab wants to merge 1 commit into
Conversation
|
@apvxlab: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsI understand the commands that are listed here |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesBody Size Defaults
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
02488c8 to
f16d813
Compare
determineMaxBodySize indexes size[len(size)-1] after finding the
nginx.ingress.kubernetes.io/proxy-body-size annotation, but does not
handle an empty value, so annotating the Mattermost ingress with an
empty proxy-body-size ("") panics (index out of range) during reconcile.
Treat an empty value like a missing one and return the default size.
Adds a regression test case.
f16d813 to
37093a7
Compare
|
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
determineMaxBodySize(pkg/mattermost/helpers.go) reads thenginx.ingress.kubernetes.io/proxy-body-sizeingress annotation and then indexessize[len(size)-1]without handling an empty value. Setting that annotation to""panics (index out of range) during reconcile.Fix: treat an empty annotation value the same as a missing one and return the default size. Adds a regression test case.