Skip to content

Commit 638784e

Browse files
authored
Merge pull request spring-cloud#2163 from wind57/minor-cleanup-before-fix-issue-2148
minor cleanup before fixing 2148
2 parents 36e204f + 836a884 commit 638784e

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/reload/ConfigReloadUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static boolean changed(List<? extends MapPropertySource> k8sSources, List<? exte
178178
LOG.debug("k8s property sources size: " + k8sSources.size());
179179
k8sSources.forEach(item -> LOG.debug(item.toString()));
180180

181-
LOG.debug("app property sources size size: " + appSources.size());
181+
LOG.debug("app property sources size: " + appSources.size());
182182
appSources.forEach(item -> LOG.debug(item.toString()));
183183
}
184184
LOG.warn(() -> "The current number of PropertySources does not match "

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/reload/PollingConfigMapChangeDetector.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ public class PollingConfigMapChangeDetector extends ConfigurationChangeDetector
4747

4848
private final long period;
4949

50-
// this beans has already a Conditional on this property, we only have it here
50+
// this bean already has a Conditional on this property, we only have it here
5151
// in case it is created manually.
5252
private final boolean monitorConfigMaps;
5353

54-
public PollingConfigMapChangeDetector(AbstractEnvironment environment, ConfigReloadProperties properties,
55-
ConfigurationUpdateStrategy strategy, Class<? extends MapPropertySource> propertySourceClass,
56-
PropertySourceLocator propertySourceLocator, TaskScheduler taskExecutor) {
57-
super(environment, properties, strategy);
54+
public PollingConfigMapChangeDetector(AbstractEnvironment environment,
55+
ConfigReloadProperties configReloadProperties, ConfigurationUpdateStrategy strategy,
56+
Class<? extends MapPropertySource> propertySourceClass, PropertySourceLocator propertySourceLocator,
57+
TaskScheduler taskExecutor) {
58+
super(environment, configReloadProperties, strategy);
5859
this.propertySourceLocator = propertySourceLocator;
5960
this.propertySourceClass = propertySourceClass;
6061
this.taskExecutor = taskExecutor;

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/reload/PollingSecretsChangeDetector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public class PollingSecretsChangeDetector extends ConfigurationChangeDetector {
5151
// in case it is created manually.
5252
private final boolean monitorSecrets;
5353

54-
public PollingSecretsChangeDetector(AbstractEnvironment environment, ConfigReloadProperties properties,
54+
public PollingSecretsChangeDetector(AbstractEnvironment environment, ConfigReloadProperties configReloadProperties,
5555
ConfigurationUpdateStrategy strategy, Class<? extends MapPropertySource> propertySourceClass,
5656
PropertySourceLocator propertySourceLocator, TaskScheduler taskExecutor) {
57-
super(environment, properties, strategy);
57+
super(environment, configReloadProperties, strategy);
5858
this.propertySourceLocator = propertySourceLocator;
5959
this.propertySourceClass = propertySourceClass;
6060
this.taskExecutor = taskExecutor;

spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/reload/Fabric8ConfigReloadAutoConfiguration.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class Fabric8ConfigReloadAutoConfiguration {
7171

7272
/**
7373
* Polling configMap ConfigurationChangeDetector.
74-
* @param properties config reload properties
74+
* @param configReloadProperties config reload properties
7575
* @param strategy configuration update strategy
7676
* @param fabric8ConfigMapPropertySourceLocator configMap property source locator
7777
* @return a bean that listen to configuration changes and fire a reload.
@@ -80,19 +80,19 @@ public class Fabric8ConfigReloadAutoConfiguration {
8080
@ConditionalOnConfigMapsReloadEnabled
8181
@ConditionalOnBean(Fabric8ConfigMapPropertySourceLocator.class)
8282
@Conditional(PollingReloadDetectionMode.class)
83-
public ConfigurationChangeDetector configMapPropertyChangePollingWatcher(ConfigReloadProperties properties,
84-
ConfigurationUpdateStrategy strategy,
83+
public ConfigurationChangeDetector configMapPropertyChangePollingWatcher(
84+
ConfigReloadProperties configReloadProperties, ConfigurationUpdateStrategy strategy,
8585
Fabric8ConfigMapPropertySourceLocator fabric8ConfigMapPropertySourceLocator,
8686
TaskSchedulerWrapper<TaskScheduler> taskSchedulerWrapper, AbstractEnvironment environment) {
8787

88-
return new PollingConfigMapChangeDetector(environment, properties, strategy,
88+
return new PollingConfigMapChangeDetector(environment, configReloadProperties, strategy,
8989
Fabric8ConfigMapPropertySource.class, fabric8ConfigMapPropertySourceLocator,
9090
taskSchedulerWrapper.getTaskScheduler());
9191
}
9292

9393
/**
9494
* Polling secrets ConfigurationChangeDetector.
95-
* @param properties config reload properties
95+
* @param configReloadProperties config reload properties
9696
* @param strategy configuration update strategy
9797
* @param fabric8SecretsPropertySourceLocator secrets property source locator
9898
* @return a bean that listen to configuration changes and fire a reload.
@@ -101,18 +101,19 @@ public ConfigurationChangeDetector configMapPropertyChangePollingWatcher(ConfigR
101101
@ConditionalOnSecretsReloadEnabled
102102
@ConditionalOnBean(Fabric8SecretsPropertySourceLocator.class)
103103
@Conditional(PollingReloadDetectionMode.class)
104-
public ConfigurationChangeDetector secretsPropertyChangePollingWatcher(ConfigReloadProperties properties,
105-
ConfigurationUpdateStrategy strategy,
104+
public ConfigurationChangeDetector secretsPropertyChangePollingWatcher(
105+
ConfigReloadProperties configReloadProperties, ConfigurationUpdateStrategy strategy,
106106
Fabric8SecretsPropertySourceLocator fabric8SecretsPropertySourceLocator,
107107
TaskSchedulerWrapper<TaskScheduler> taskScheduler, AbstractEnvironment environment) {
108108

109-
return new PollingSecretsChangeDetector(environment, properties, strategy, Fabric8SecretsPropertySource.class,
110-
fabric8SecretsPropertySourceLocator, taskScheduler.getTaskScheduler());
109+
return new PollingSecretsChangeDetector(environment, configReloadProperties, strategy,
110+
Fabric8SecretsPropertySource.class, fabric8SecretsPropertySourceLocator,
111+
taskScheduler.getTaskScheduler());
111112
}
112113

113114
/**
114115
* Event Based configMap ConfigurationChangeDetector.
115-
* @param properties config reload properties
116+
* @param configReloadProperties config reload properties
116117
* @param strategy configuration update strategy
117118
* @param fabric8ConfigMapPropertySourceLocator configMap property source locator
118119
* @return a bean that listen to configMap change events and fire a reload.
@@ -121,18 +122,18 @@ public ConfigurationChangeDetector secretsPropertyChangePollingWatcher(ConfigRel
121122
@ConditionalOnConfigMapsReloadEnabled
122123
@ConditionalOnBean(Fabric8ConfigMapPropertySourceLocator.class)
123124
@Conditional(EventReloadDetectionMode.class)
124-
public ConfigurationChangeDetector configMapPropertyChangeEventWatcher(ConfigReloadProperties properties,
125-
ConfigurationUpdateStrategy strategy,
125+
public ConfigurationChangeDetector configMapPropertyChangeEventWatcher(
126+
ConfigReloadProperties configReloadProperties, ConfigurationUpdateStrategy strategy,
126127
Fabric8ConfigMapPropertySourceLocator fabric8ConfigMapPropertySourceLocator,
127128
AbstractEnvironment environment, KubernetesClient kubernetesClient) {
128129

129-
return new Fabric8EventBasedConfigMapChangeDetector(environment, properties, kubernetesClient, strategy,
130-
fabric8ConfigMapPropertySourceLocator, new KubernetesNamespaceProvider(environment));
130+
return new Fabric8EventBasedConfigMapChangeDetector(environment, configReloadProperties, kubernetesClient,
131+
strategy, fabric8ConfigMapPropertySourceLocator, new KubernetesNamespaceProvider(environment));
131132
}
132133

133134
/**
134135
* Event Based secrets ConfigurationChangeDetector.
135-
* @param properties config reload properties
136+
* @param configReloadProperties config reload properties
136137
* @param strategy configuration update strategy
137138
* @param fabric8SecretsPropertySourceLocator secrets property source locator
138139
* @return a bean that listen to secrets change events and fire a reload.
@@ -141,13 +142,13 @@ public ConfigurationChangeDetector configMapPropertyChangeEventWatcher(ConfigRel
141142
@ConditionalOnSecretsReloadEnabled
142143
@ConditionalOnBean(Fabric8SecretsPropertySourceLocator.class)
143144
@Conditional(EventReloadDetectionMode.class)
144-
public ConfigurationChangeDetector secretsPropertyChangeEventWatcher(ConfigReloadProperties properties,
145+
public ConfigurationChangeDetector secretsPropertyChangeEventWatcher(ConfigReloadProperties configReloadProperties,
145146
ConfigurationUpdateStrategy strategy,
146147
Fabric8SecretsPropertySourceLocator fabric8SecretsPropertySourceLocator, AbstractEnvironment environment,
147148
KubernetesClient kubernetesClient) {
148149

149-
return new Fabric8EventBasedSecretsChangeDetector(environment, properties, kubernetesClient, strategy,
150-
fabric8SecretsPropertySourceLocator, new KubernetesNamespaceProvider(environment));
150+
return new Fabric8EventBasedSecretsChangeDetector(environment, configReloadProperties, kubernetesClient,
151+
strategy, fabric8SecretsPropertySourceLocator, new KubernetesNamespaceProvider(environment));
151152
}
152153

153154
}

0 commit comments

Comments
 (0)