You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/property-source-config/configmap-propertysource.adoc
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -475,9 +475,9 @@ spring:
475
475
476
476
The same processing rules apply when generating property source as for config maps. The only difference is that
477
477
potentially, looking up secrets by labels can mean that we find more than one source. In such a case, prefix (if specified via `useNameAsPrefix`)
478
-
will be the names of all secrets found for those particular labels.
478
+
will be the name of the secret found for those particular labels.
479
479
480
-
One more thing to bear in mind is that we support `prefix` per _source_, not per secret. The easiest way to explain this is via an example:
480
+
One more thing to bear in mind is that we support `prefix` per _secret_. The easiest way to explain this is via an example:
481
481
482
482
[source.yaml]
483
483
----
@@ -496,14 +496,11 @@ spring:
496
496
useNameAsPrefix: true
497
497
----
498
498
499
-
Suppose that a query matching such a label will provide two secrets as a result: `secret-a` and `secret-b`.
500
-
Both of these secrets have the same property name: `color=sea-blue` and `color=ocean-blue`. It is undefined which
501
-
`color` will end-up as part of property sources, but the prefix for it will be `secret-a.secret-b`
502
-
(concatenated sorted naturally, names of the secrets).
503
-
504
-
If you need more fine-grained results, adding more labels to identify the secret uniquely would be an option.
505
-
499
+
Suppose that a query matching such a label will return two secrets as a result: `secretA` and `secretB`.
500
+
Both of these secrets have the same property name: `color=sea-blue` and `color=ocean-blue`. Because `useNamesAsPrefix=true`, there will be two property sources loaded:
506
501
502
+
- `secretA.color=sea-blue`
503
+
- `secretB.color=ocean-blue`
507
504
508
505
By default, besides reading the config map that is specified in the `sources` configuration, Spring will also try to read
509
506
all properties from "profile aware" sources. The easiest way to explain this is via an example. Let's suppose your application
0 commit comments