servicebinding / spec

Specification for binding services to k8s workloads
https://servicebinding.io
Apache License 2.0
92 stars 35 forks source link

Allow constant values in CRD annotation #140

Closed johnpoth closed 3 years ago

johnpoth commented 3 years ago

It would be useful to allow constant values when annotating the CRD with service binding information e.g:

service.binding/provider: postgresql

This would be useful for example when filling out the type and provider information for a Database which does not change.

Thanks !

baijum commented 3 years ago

@johnpoth The type and provider values can override in the ServiceBinding resource.

johnpoth commented 3 years ago

hi @baijum could you elaborate a little bit ? Not sure I fully understand

scothis commented 3 years ago

@baijum I believe the example was to define the provider on the service CRD/CR rather than needing to redefine the value for each ServiceBinding

baijum commented 3 years ago

hi @baijum could you elaborate a little bit ? Not sure I fully understand

I was referring to the last paragraph in the Reconciler Implementation section of the spec, which reads like this:

If a .spec.type is set, the type entry in the application projection MUST be set to its value overriding any existing value. If a .spec.provider is set, the provider entry in the application projection MUST be set to its value overriding any existing value.

But if the CRD/CR annotation itself required a mechanism to provide these values, your proposed PR looks good to me.

cc. @sbose78 @pedjak