Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shedfreez committed Nov 20, 2024
1 parent 5bd61a2 commit 26ee143
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,15 @@ private void initTsfConfigGroups(CompositePropertySource compositePropertySource
return;
}
String namespace = polarisContextProperties.getNamespace();
List<String> tsfConfigGroups = Arrays.asList(tsfId + "." + tsfGroupName + ".config_group", tsfId + "." + tsfNamespaceName + ".config_group");
List<String> tsfConfigGroups = Arrays.asList(
tsfId + "." + tsfGroupName + ".application_config_group",
tsfId + "." + tsfNamespaceName + ".global_config_group");
for (String tsfConfigGroup : tsfConfigGroups) {
PolarisPropertySource polarisPropertySource = loadGroupPolarisPropertySource(configFileService, namespace, tsfConfigGroup);
if (polarisPropertySource == null) {
// not register to polaris
continue;
}
compositePropertySource.addPropertySource(polarisPropertySource);
PolarisPropertySourceManager.addPropertySource(polarisPropertySource);
}
Expand All @@ -244,6 +250,9 @@ private void initCustomPolarisConfigFiles(CompositePropertySource compositePrope

if (CollectionUtils.isEmpty(files)) {
PolarisPropertySource polarisPropertySource = loadGroupPolarisPropertySource(configFileService, namespace, group);
if (polarisPropertySource == null) {
continue;
}
compositePropertySource.addPropertySource(polarisPropertySource);
PolarisPropertySourceManager.addPropertySource(polarisPropertySource);
LOGGER.info("[SCT Config] Load and inject polaris config file success. namespace = {}, group = {}", namespace, group);
Expand Down Expand Up @@ -289,6 +298,9 @@ public static PolarisPropertySource loadGroupPolarisPropertySource(ConfigFileSer
List<ConfigKVFile> configKVFiles = new ArrayList<>();

com.tencent.polaris.configuration.api.core.ConfigFileGroup remoteGroup = configFileService.getConfigFileGroup(namespace, group);
if (remoteGroup == null) {
return null;
}

for (ConfigFileMetadata configFile : remoteGroup.getConfigFileMetadataList()) {
String fileName = configFile.getFileName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ private void registerPolarisConfigPublishEvent() {

// register polaris config publish event
for (PolarisPropertySource polarisPropertySource : polarisPropertySources) {
// group property source
if (polarisPropertySource.getConfigKVFile() instanceof CompositeConfigFile) {
CompositeConfigFile configKVFile = (CompositeConfigFile) polarisPropertySource.getConfigKVFile();
for (ConfigKVFile cf : configKVFile.getConfigKVFiles()) {
Expand Down

0 comments on commit 26ee143

Please sign in to comment.