-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup for config server #1615
Changes from all commits
032014e
c3d0ad2
10889fd
8f0375a
96ebf42
db8403e
90a5345
b041c00
9580444
a34ac47
6613f78
1b3eae9
4275382
618f25a
100a9cd
4b9056b
315a85b
ed3c264
446d630
6821a28
9e95a8a
02840b1
7e31d65
926f4d7
344e1d4
e91ac12
ba6e088
49025e8
a647bb3
16b09ab
c8d8a72
591f340
c331bd0
f48b22b
900843d
76ecdd5
b69d4a6
df2ddcc
3ff1cdd
bd89cc8
39ef510
d389953
b676bac
b1473c9
83ff113
33dfbb7
316af58
425d30b
763280a
3afbaef
cb97ba1
b33edc8
7a1fdf1
a8beed9
2e445d9
5b51db1
b0ce76c
918bb7f
c629951
ccfc0bf
0f3fa24
b60a283
901cb66
251002b
fedeb17
004f95b
10168be
dc811cf
3dfe77d
619c8d0
12ca211
a91c1e1
be2e809
1c84e33
1319fe7
9424c2e
cddd550
f8d34f2
31d2fb8
fa9fd09
22f3f51
bb44f4b
9714f2c
0f9cb3d
6e60174
78c5575
5eb5c51
48f7cb0
8a18085
e4cab39
ba4cab0
bbc6e30
0e9f1ad
8a5243c
cbf83c4
3dd0260
1408d44
2925ee1
af3a12b
f5a27dc
494454a
add0f67
b6a4b45
00a559d
882f9c1
6c9071e
09c10bb
3615396
116c199
f1447cd
14b165b
3ce8fac
41eaa8d
4f89298
ee1031d
f6707d5
9930c7d
0043006
4e292ec
3129276
1c90fc2
fa0888a
ab680d1
4023ca3
7ed7f5d
3be81b7
dd710ec
4fdd06a
bf61054
f059697
013cc6a
13ff3b3
88021bb
dcf4e62
a600c69
3f1a180
85ca441
65acfe6
5526b50
06877c9
0f6989a
ea130d2
a03ac7f
0c131b5
999caab
83cef76
bac7471
36bb7d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,11 +194,11 @@ public static MultipleSourcesContainer processNamedData(List<StrippedSourceConta | |
// processed before profile based sources. This way, we replicate that | ||
// "application-dev.yaml" | ||
// overrides properties from "application.yaml" | ||
sourceNames.forEach(source -> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to present the minor changes I have in mind in small batches, so that it's easier to review, so a few more like this will follow. What I am doing here is rename
to
|
||
StrippedSourceContainer stripped = hashByName.get(source); | ||
sourceNames.forEach(sourceName -> { | ||
StrippedSourceContainer stripped = hashByName.get(sourceName); | ||
if (stripped != null) { | ||
LOG.debug("Found source with name : '" + source + " in namespace: '" + namespace + "'"); | ||
foundSourceNames.add(source); | ||
LOG.debug("Found source with name : '" + sourceName + " in namespace: '" + namespace + "'"); | ||
foundSourceNames.add(sourceName); | ||
// see if data is a single yaml/properties file and if it needs decoding | ||
Map<String, String> rawData = stripped.data(); | ||
if (decode) { | ||
|
@@ -212,7 +212,8 @@ public static MultipleSourcesContainer processNamedData(List<StrippedSourceConta | |
//Check the source to see if it contains any active profiles | ||
boolean containsActiveProfile = environment.getActiveProfiles().length == 0 | ||
|| Arrays.stream(environment.getActiveProfiles()) | ||
.anyMatch(p -> source.contains("-" + p) || "default".equals(p)); | ||
.anyMatch(activeProfile -> sourceName.endsWith("-" + activeProfile) | ||
|| "default".equals(activeProfile)); | ||
if (includeDefaultProfileData || containsActiveProfile | ||
|| containsDataWithProfile(rawData, environment.getActiveProfiles())) { | ||
data.putAll(SourceDataEntriesProcessor.processAllEntries(rawData == null ? Map.of() : rawData, | ||
|
@@ -230,7 +231,8 @@ public static MultipleSourcesContainer processNamedData(List<StrippedSourceConta | |
*/ | ||
private static boolean containsDataWithProfile(Map<String, String> rawData, String[] activeProfiles) { | ||
return rawData.keySet().stream().anyMatch( | ||
key -> Arrays.stream(activeProfiles).anyMatch(p -> key.contains("-" + p) || "default".equals(p))); | ||
key -> Arrays.stream(activeProfiles).anyMatch(activeProfile -> key.contains("-" + activeProfile) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sholdn't this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not here no, good eye though :) in the case above we check the source name (config map name), so its something like : In the case here, we check for In my next PR, I will amend this a bit too. |
||
|| "default".equals(activeProfile))); | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are never used