diff --git a/README.md b/README.md index f5a2500..1c4e713 100644 --- a/README.md +++ b/README.md @@ -197,11 +197,11 @@ rules: # Application Projection -A Binding `Secret` **MUST** be volume mounted into a container at `$SERVICE_BINDING_ROOT/` with directory names matching the name of the binding. Binding names **MUST** match `[a-z0-9\-\.]{1,253}`. The `$SERVICE_BINDING_ROOT` environment variable **MUST** be declared and can point to any valid file system location. +A projected binding **MUST** be volume mounted into a container at `$SERVICE_BINDING_ROOT/` with directory names matching the name of the binding. Binding names **MUST** match `[a-z0-9\-\.]{1,253}`. The `$SERVICE_BINDING_ROOT` environment variable **MUST** be declared and can point to any valid file system location. -The `Secret` data **MUST** contain a `type` entry with a value that identifies the abstract classification of the binding. The `Secret` type (`.type` verses `.data.type`) **MUST** reflect this value as `service.binding/{type}`, replacing `{type}` with the `Secret` data type. It is **RECOMMENDED** that the `Secret` data also contain a `provider` entry with a value that identifies the provider of the binding. The `Secret` data **MAY** contain any other entry. +The projected binding **MUST** contain a `type` entry with a value that identifies the abstract classification of the binding. It is **RECOMMENDED** that the projected binding also contain a `provider` entry with a value that identifies the provider of the binding. The projected binding data **MAY** contain any other entry. -The name of a secret entry file name **SHOULD** match `[a-z0-9\-\.]{1,253}`. The contents of a secret entry may be anything representable as bytes on the file system including, but not limited to, a literal string value (e.g. `db-password`), a language-specific binary (e.g. a Java `KeyStore` with a private key and X.509 certificate), or an indirect pointer to another system for value resolution (e.g. `vault://production-database/password`). +The name of a binding entry file name **SHOULD** match `[a-z0-9\-\.]{1,253}`. The contents of a binding entry may be anything representable as bytes on the file system including, but not limited to, a literal string value (e.g. `db-password`), a language-specific binary (e.g. a Java `KeyStore` with a private key and X.509 certificate), or an indirect pointer to another system for value resolution (e.g. `vault://production-database/password`). The collection of files within the directory **MAY** change between container launches. The collection of files within the directory **SHOULD NOT** change during the lifetime of the container. @@ -284,6 +284,8 @@ metadata: ... spec: name: # string, optional, default: .metadata.name + type: # string, optional + provider: # string, optional application: # ObjectReference-like apiVersion: # string @@ -414,6 +416,8 @@ If the `$SERVICE_BINDING_ROOT` environment variable has already been configured The `$SERVICE_BINDING_ROOT` environment variable **MUST NOT** be reset if it is already configured on the resource represented by `application`. +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. + ### Ready Condition Status If the modification of the Application resource is completed successfully, the `Ready` condition status **MUST** be set to `True`. If the modification of the Application resource is not completed successfully the `Ready` condition status **MUST NOT** be set to `True`. diff --git a/internal/service.binding/v1alpha2/service_binding.go b/internal/service.binding/v1alpha2/service_binding.go index 9739545..9bf62e5 100644 --- a/internal/service.binding/v1alpha2/service_binding.go +++ b/internal/service.binding/v1alpha2/service_binding.go @@ -68,6 +68,10 @@ type EnvMapping struct { type ServiceBindingSpec struct { // Name is the name of the service as projected into the application container. Defaults to .metadata.name. Name string `json:"name,omitempty"` + // Type is the type of the service as projected into the application container + Type string `json:"type,omitempty"` + // Provider is the provider of the service as projected into the application container + Provider string `json:"provider,omitempty"` // Application is a reference to an object Application ServiceBindingApplicationReference `json:"application"` // Service is a reference to an object that fulfills the ProvisionedService duck type diff --git a/service.binding_servicebindings.yaml b/service.binding_servicebindings.yaml index 79a3ded..2920886 100644 --- a/service.binding_servicebindings.yaml +++ b/service.binding_servicebindings.yaml @@ -115,6 +115,9 @@ spec: name: description: Name is the name of the service as projected into the application container. Defaults to .metadata.name. type: string + provider: + description: Provider is the provider of the service as projected into the application container + type: string service: description: Service is a reference to an object that fulfills the ProvisionedService duck type properties: @@ -132,6 +135,9 @@ spec: - kind - name type: object + type: + description: Type is the type of the service as projected into the application container + type: string required: - application - service