fix(eks): truncate kubectl error output to avoid CloudFormation respo…#37384
fix(eks): truncate kubectl error output to avoid CloudFormation respo…#37384ashoknarayan wants to merge 3 commits intoaws:mainfrom
Conversation
There was a problem hiding this comment.
The pull request linter fails with the following errors:
❌ Fixes must contain a change to a test file.
❌ Fixes must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.
✅ A exemption request has been requested. Please wait for a maintainer's review.
|
Exemption Request This change modifies error handling in the kubectl Lambda handler by truncating error messages to stay within CloudFormation response size limits. There is no change to synthesized infrastructure or observable template output, and the behavior is only triggered during runtime error scenarios. As such, adding integration tests or snapshot updates would not provide meaningful coverage. Please let me know if you would still prefer a specific test approach. |
Fixes #37353
Problem
kubectl errors can exceed CloudFormation's 4KB response size limit, causing the actual error message to be lost and replaced with a generic "Response object is too long" message.
Solution
Truncate kubectl error output before raising exceptions to ensure it stays within safe limits.
Changes
Notes
This preserves useful error context while preventing CloudFormation response overflow.