Skip to content

Fix: Add proper error handling to CompositeConnectionDetails - #663

Open
ogormans-deptstack wants to merge 1 commit into
crossplane-contrib:mainfrom
ogormans-deptstack:fix/composite-connection-details-errors
Open

ogormans-deptstack wants to merge 1 commit into
crossplane-contrib:mainfrom
ogormans-deptstack:fix/composite-connection-details-errors

Conversation

@ogormans-deptstack

Copy link
Copy Markdown

Summary of Changes

Adds proper error handling to the CompositeConnectionDetails meta kind handler. Previously, base64 decode errors and missing 'data' fields were silently suppressed, leading to cryptic downstream Crossplane errors. Now:

  1. Validates that 'data' field exists and is properly formatted
  2. Validates base64 encoding before passing to Crossplane
  3. Reports errors via response.Fatal() with actionable messages (matching Context/ExtraResources pattern)
  4. Composition Synced condition is set with the error message

Fixes #40

Testing

Added table-driven test cases for:

  • Missing 'data' field
  • 'data' field not a string map
  • Invalid base64 values in data

All cases verify response.Fatal() is called and error message is set correctly.

Checklist

  • Follows existing error-handling pattern (response.Fatal)
  • Added test coverage for error paths
  • Code is consistent with fn.go style

Signed-off-by: Sean O'Gorman <sean.ogorman@deptagency.com>
@ogormans-deptstack

Copy link
Copy Markdown
Author

@sergenyalcin
sergenyalcin
@turkenf
turkenf
@ezgidemirel
ezgidemirel
@phisco
phisco
@bobh66
bobh66
@ulucinar
ulucinar
@adamwg
adamwg
anyone available to take a look at my prs please

@ezgidemirel ezgidemirel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR @ogormans-deptstack, LGTM!

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.

Misleading errors when using CompositeConnectionDetails

2 participants