openservicebrokerapi / servicebroker

Open Service Broker API Specification
https://openservicebrokerapi.org/
Apache License 2.0
1.19k stars 436 forks source link

Inconsistencies between `ServiceBindingMetadata` and `ServiceInstanceMetadata` #745

Open WalkerGriggs opened 2 years ago

WalkerGriggs commented 2 years ago

What is the problem?

ServiceInstanceMetadata is fairly general: only two opaque objects.

    ServiceInstanceMetadata:
      type: object
      properties:
        labels:
          type: object
        attributes:
          type: object

but the ServiceBindingMetadata is more specific.

    ServiceBindingMetadata:
      type: object
      properties:
        expires_at:
          type: string
        renew_before:
          type: string

The parallel in names suggests they are functionally equivalent, but this inconsistency changes how brokers use the two objects.

For example, a broker may want to add a general created_at field to both resource's metadata objects, but can't for the service binding.

Or more holistically, it sends mixed messages about OSB as a prescriptive or general specification.

Who does this affect?

Broker authors and platforms.

Do you have any proposed solutions?

Replace the specific ServiceBindingMetadata fields in favor of attributes and labels, or add the two fields in addition to existing, specific ones. The latter is probably better for backwards compatibility.

    ServiceBindingMetadata:
      type: object
      properties:
        labels:
          type: object
        attributes:
          type: object

or

    ServiceBindingMetadata:
      type: object
      properties:
        expires_at:
          type: string
        renew_before:
          type: string
        labels:
          type: object
        attributes:
          type: object
WalkerGriggs commented 2 years ago

I'm happy to open an PR, but collecting feedback for now.