You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve bundle unpack failure handling and user experience (#3832)
This commit improves the handling and messaging of bundle unpack failures
in OLM to provide better user experience and follows Kubernetes controller
best practices.
Key improvements:
1. User-friendly error messages
- Provide clear, actionable error messages for bundle unpack failures
- Include common causes and troubleshooting steps
- Add auto-retry information and manual remediation commands
2. Reduced etcd payload bloat
- Keep subscription condition messages concise
- Emit detailed troubleshooting guidance as Kubernetes Events
- Prevents storing large 329-char strings repeatedly in etcd
3. Prevent duplicate guidance in messages
- Check if guidance already exists before appending
- Avoids message duplication from underlying conditions
4. Fix variable shadowing
- Rename inner 'cond' to 'unpackingCond' for clarity
- Improves code readability and prevents confusion
5. Prevent queue churn from repeated requeues
- Track state transitions with isNewFailure flag
- Only schedule delayed requeue on new failures
- Prevents repeated AddAfter calls for persistent failures
6. Use exact constant comparison for JobIncompleteReason
- Replace strings.Contains() with bundle.JobIncompleteReason
- More deterministic and type-safe
- Prevents matching unintended substring values
7. Improve test maintainability
- Use substring assertions instead of exact message matching
- Tests won't break on minor wording/punctuation changes
- Verify key components: prefix, reason, error, guidance
All tests pass. Changes follow Kubernetes controller best practices.
Co-authored-by: Rohit Patil <ropatil@ropatil-thinkpadp16vgen1.bengluru.csb>
0 commit comments