summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-12-03 23:02:31 +0000
committerGerrit Code Review <review@openstack.org>2018-12-03 23:02:31 +0000
commit1e0987046f334d3efea8d693d39a7306cf5bd3c4 (patch)
tree90996b95b42685fb8db50901a309d2715d479e67
parent139cabd106727d41790005d998a84cc1edba1f6e (diff)
parent815306ddf8977ca1da135d701b36a1d071f38593 (diff)
Merge "docs(substitution): mention that all occurrences are replaced"
-rw-r--r--doc/source/users/substitution.rst27
1 files changed, 26 insertions, 1 deletions
diff --git a/doc/source/users/substitution.rst b/doc/source/users/substitution.rst
index e6fcc02..7554c4e 100644
--- a/doc/source/users/substitution.rst
+++ b/doc/source/users/substitution.rst
@@ -208,7 +208,9 @@ the hood. The ``dest.pattern`` has the following constraints:
208* The ``dest.pattern`` must be resolvable in the value of ``dest.path``. 208* The ``dest.pattern`` must be resolvable in the value of ``dest.path``.
209 209
210If the above constraints are met, then more precise substitution via a pattern 210If the above constraints are met, then more precise substitution via a pattern
211can be carried out. 211can be carried out. If ``dest.path`` is a string or multiline string then all
212occurrences of ``dest.pattern`` found in ``dest.path`` will be replaced. To handle
213a more complex ``dest.path`` read `Recursive Replacement of Patterns`_.
212 214
213Example 215Example
214^^^^^^^ 216^^^^^^^
@@ -226,6 +228,16 @@ Example
226 storagePolicy: cleartext 228 storagePolicy: cleartext
227 data: my-secret-password 229 data: my-secret-password
228 --- 230 ---
231 # Another source document.
232 schema: deckhand/Passphrase/v1
233 metadata:
234 name: another-password
235 schema: metadata/Document/v1
236 layeringDefinition:
237 layer: site
238 storagePolicy: cleartext
239 data: another-secret-password
240 ---
229 # Destination document. 241 # Destination document.
230 schema: armada/Chart/v1 242 schema: armada/Chart/v1
231 metadata: 243 metadata:
@@ -241,12 +253,22 @@ Example
241 schema: deckhand/Passphrase/v1 253 schema: deckhand/Passphrase/v1
242 name: example-password 254 name: example-password
243 path: . 255 path: .
256 - dest:
257 path: .chart.values.script
258 pattern: INSERT_ANOTHER_PASSWORD
259 src:
260 schema: deckhand/Passphrase/v1
261 name: another-password
262 path: .
244 data: 263 data:
245 chart: 264 chart:
246 details: 265 details:
247 data: here 266 data: here
248 values: 267 values:
249 some_url: http://admin:INSERT_PASSWORD_HERE@service-name:8080/v1 268 some_url: http://admin:INSERT_PASSWORD_HERE@service-name:8080/v1
269 script: |
270 some_function("INSERT_ANOTHER_PASSWORD")
271 another_function("INSERT_ANOTHER_PASSWORD")
250 272
251After document rendering, the output for ``example-chart-01`` (the destination 273After document rendering, the output for ``example-chart-01`` (the destination
252document) will be: 274document) will be:
@@ -267,6 +289,9 @@ document) will be:
267 # Notice string replacement occurs at exact location specified by 289 # Notice string replacement occurs at exact location specified by
268 # ``dest.pattern``. 290 # ``dest.pattern``.
269 some_url: http://admin:my-secret-password@service-name:8080/v1 291 some_url: http://admin:my-secret-password@service-name:8080/v1
292 script: |
293 some_function("another-secret-password")
294 another_function("another-secret-password")
270 295
271Recursive Replacement of Patterns 296Recursive Replacement of Patterns
272^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 297^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^