Skip to content

Commit 78efe97

Browse files
authored
Merge pull request #39237 from Srivaralakshmi/DataModelSBO
Document data model
2 parents 17d9dee + 5435efe commit 78efe97

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

applications/connecting_applications_to_services/exposing-binding-data-from-a-service.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Application developers need access to backing services to build and connect work
1111
The {servicebinding-title} enables application developers to easily bind workloads together with operator-managed backing services, without any manual procedures to configure the binding connection. For the {servicebinding-title} to provide the binding data, as an Operator provider or user who creates backing services, you must expose the binding data to be automatically detected by the {servicebinding-title}. Then, the {servicebinding-title} automatically collects the binding data from the backing service and shares it with a workload to provide a consistent and predictable experience.
1212

1313
include::modules/sbo-methods-of-exposing-binding-data.adoc[leveloffset=+1]
14-
14+
include::modules/sbo-data-model.adoc[leveloffset=+1]
1515
include::modules/sbo-categories-of-exposable-binding-data.adoc[leveloffset=+1]
1616

1717
== Additional resources

modules/sbo-data-model.adoc

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Module included in the following assemblies:
2+
//
3+
// *openshift-docs/applications/connecting_applications_to_services/exposing-binding-data-from-a-service
4+
[id="sbo-data-model_{context}"]
5+
= Data model
6+
7+
Service binding annotations must use the following convention:
8+
9+
[source,yaml]
10+
----
11+
service.binding(/<NAME>)?:
12+
"<VALUE>|(path=<JSONPATH_TEMPLATE>(,objectType=<OBJECT_TYPE>)?(,elementType=<ELEMENT_TYPE>)?(,sourceKey=<SOURCE_KEY>)?(,sourceValue=<SOURCE_VALUE>)?)"
13+
----
14+
where:
15+
[horizontal]
16+
`<NAME>`:: Specifies the name under which the binding value is to be exposed. You can exclude it only when the `objectType` parameter is set to `Secret` or `ConfigMap`.
17+
`<VALUE>`:: Specifies the constant value exposed when no `path` is set.
18+
19+
This section explains the data model used in the annotations and OLM descriptors. The data model is the same for custom resource definition (CRD) or custom resource (CR) annotations and Operator Lifecycle Manager (OLM) descriptors, but the syntax differs.
20+
21+
The data model provides the details on the allowed values and semantic for the `path`, `elementType`, `objectType`, `sourceKey`, and `sourceValue` parameters.
22+
23+
.Parameters and their descriptions
24+
[cols="3,6,4",options="header"]
25+
|===
26+
|Parameter
27+
|Description
28+
|Default value
29+
30+
|`path`
31+
|JSONPath template that consists JSONPath expressions enclosed by curly braces {}.
32+
|N/A
33+
34+
|`elementType`
35+
a|Specifies whether the value of the element referenced in the `path` parameter complies with any one of the following types:
36+
37+
* `string`
38+
* `sliceOfStrings`
39+
* `sliceOfMaps`
40+
|`string`
41+
42+
|`objectType`
43+
|Specifies whether the value of the element indicated in the `path` parameter refers to a `ConfigMap`, `Secret`, or plain string in the current namespace.
44+
|`Secret`, if `elementType` is non-string.
45+
46+
47+
|`sourceKey`
48+
a|Specifies the key in the `ConfigMap` or `Secret` resource to be added to the binding secret when collecting the binding data. +
49+
50+
Note:
51+
52+
* When used in conjunction with `elementType`=`sliceOfMaps`, the `sourceKey` parameter specifies the key in the slice of maps whose value is used as a key in the binding secret.
53+
* Use this optional parameter to expose a specific entry in the referenced `Secret` or `ConfigMap` resource as binding data.
54+
* When not specified, all keys and values from the `Secret` or `ConfigMap` resource are exposed and are added to the binding secret.
55+
|N/A
56+
57+
|`sourceValue`
58+
a|Specifies the key in the slice of maps. +
59+
60+
Note:
61+
62+
* The value of this key is used as the base to generate the value of the entry for the key-value pair to be added to the binding secret.
63+
* In addition, the value of the `sourceKey` is used as the key of the entry for the key-value pair to be added to the binding secret.
64+
* It is mandatory only if `elementType`=`sliceOfMaps`.
65+
|N/A
66+
|===
67+
68+
[NOTE]
69+
====
70+
The `sourceKey` and `sourceValue` parameters are applicable only if the element indicated in the `path` parameter refers to a `ConfigMap` or `Secret` resource.
71+
====

0 commit comments

Comments
 (0)