Skip to content

Commit 6659a62

Browse files
authored
Merge pull request #1919 from wind57/fix-1757-documentation
documentation for issue 1757
2 parents 651feb5 + 2cb10a3 commit 6659a62

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

docs/modules/ROOT/pages/property-source-config/configmap-propertysource.adoc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,9 @@ spring:
475475

476476
The same processing rules apply when generating property source as for config maps. The only difference is that
477477
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.
479479

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:
481481

482482
[source.yaml]
483483
----
@@ -496,14 +496,11 @@ spring:
496496
useNameAsPrefix: true
497497
----
498498

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:
506501

502+
- `secretA.color=sea-blue`
503+
- `secretB.color=ocean-blue`
507504

508505
By default, besides reading the config map that is specified in the `sources` configuration, Spring will also try to read
509506
all properties from "profile aware" sources. The easiest way to explain this is via an example. Let's suppose your application

0 commit comments

Comments
 (0)