Skip to content

Conversation

@philippthun
Copy link
Member

@philippthun philippthun commented Dec 2, 2025

  • Convert IncompatibleBindings error to UnprocessableEntity (ApiError)
  • Fix validation of conflicting manifest features
  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@philippthun philippthun changed the title File based service bindings improved errors File-based-service-bindings: improved errors Dec 2, 2025
@philippthun philippthun marked this pull request as ready for review December 2, 2025 13:13
volume_mounted_files: ServiceBindingFilesBuilder.build(staging_details.package.app)
}.compact)
rescue ServiceBindingFilesBuilder::IncompatibleBindings => e
raise CloudController::Errors::ApiError.new_from_details('UnprocessableEntity', "Cannot build service binding files - #{e.message}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use different error messages for these 3 cases? To make the location of the source easier?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 It's now:

  • Cannot build service binding files for app
  • Cannot build service binding files for app task
  • Cannot build service binding files for staging task

The ServiceBindingFilesBuilder can raise an IncompatibleBindings
exception in case of entries violating the specification for file names
or if the overall file size is too big. When pushing an app these errors
were shown as StagerErrors (with the correct error message); for other
operations - i.e. restart, restage - an UnknownError was returned. This
change ensures that in any case an UnprocessableEntity (ApiError) is
returned (with the concrete error message).
Switching from service-binding-k8s to file-based-vcap-services via
manifest entries (features) raised an error. This change fixes the wrong
validation for this corner case.
@philippthun philippthun force-pushed the file-based-service-bindings-improved-errors branch from 41fbc23 to 00fa649 Compare December 2, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants