4949import org .springframework .boot .test .system .OutputCaptureExtension ;
5050import org .springframework .cloud .kubernetes .client .config .KubernetesClientConfigMapPropertySource ;
5151import org .springframework .cloud .kubernetes .client .config .KubernetesClientConfigMapPropertySourceLocator ;
52+ import org .springframework .cloud .kubernetes .client .config .KubernetesClientSecretsPropertySource ;
53+ import org .springframework .cloud .kubernetes .client .config .KubernetesClientSecretsPropertySourceLocator ;
5254import org .springframework .cloud .kubernetes .commons .KubernetesNamespaceProvider ;
5355import org .springframework .cloud .kubernetes .commons .config .ConfigMapConfigProperties ;
5456import org .springframework .cloud .kubernetes .commons .config .RetryProperties ;
57+ import org .springframework .cloud .kubernetes .commons .config .SecretsConfigProperties ;
5558import org .springframework .cloud .kubernetes .commons .config .reload .ConfigReloadProperties ;
5659import org .springframework .cloud .kubernetes .commons .config .reload .ConfigurationUpdateStrategy ;
5760import org .springframework .cloud .kubernetes .commons .config .reload .PollingConfigMapChangeDetector ;
61+ import org .springframework .cloud .kubernetes .commons .config .reload .PollingSecretsChangeDetector ;
5862import org .springframework .context .annotation .Bean ;
5963import org .springframework .context .annotation .Primary ;
6064import org .springframework .core .env .AbstractEnvironment ;
@@ -168,13 +172,13 @@ static class TestConfig {
168172
169173 @ Bean
170174 @ Primary
171- PollingConfigMapChangeDetector pollingConfigMapChangeDetector (AbstractEnvironment environment ,
175+ PollingSecretsChangeDetector pollingSecretsChangeDetector (AbstractEnvironment environment ,
172176 ConfigReloadProperties configReloadProperties , ConfigurationUpdateStrategy configurationUpdateStrategy ,
173- KubernetesClientConfigMapPropertySourceLocator kubernetesClientConfigMapPropertySourceLocator ) {
177+ KubernetesClientSecretsPropertySourceLocator kubernetesClientSecretsPropertySourceLocator ) {
174178 ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler ();
175179 scheduler .initialize ();
176- return new PollingConfigMapChangeDetector (environment , configReloadProperties , configurationUpdateStrategy ,
177- KubernetesClientConfigMapPropertySource .class , kubernetesClientConfigMapPropertySourceLocator , scheduler );
180+ return new PollingSecretsChangeDetector (environment , configReloadProperties , configurationUpdateStrategy ,
181+ KubernetesClientSecretsPropertySource .class , kubernetesClientSecretsPropertySourceLocator , scheduler );
178182 }
179183
180184 @ Bean
@@ -207,8 +211,8 @@ ConfigReloadProperties configReloadProperties() {
207211
208212 @ Bean
209213 @ Primary
210- ConfigMapConfigProperties configMapConfigProperties () {
211- return new ConfigMapConfigProperties (true , List .of (), List .of (), Map .of (), true , SECRET_NAME , NAMESPACE ,
214+ SecretsConfigProperties configMapConfigProperties () {
215+ return new SecretsConfigProperties (true , List .of (), List .of (), Map .of (), true , SECRET_NAME , NAMESPACE ,
212216 false , true , FAIL_FAST , RetryProperties .DEFAULT );
213217 }
214218
@@ -228,7 +232,7 @@ ConfigurationUpdateStrategy configurationUpdateStrategy() {
228232
229233 @ Bean
230234 @ Primary
231- KubernetesClientConfigMapPropertySourceLocator kubernetesClientConfigMapPropertySourceLocator (
235+ KubernetesClientSecretsPropertySourceLocator kubernetesClientSecretsPropertySourceLocator (
232236 ConfigMapConfigProperties configMapConfigProperties , KubernetesNamespaceProvider namespaceProvider ) {
233237 return new KubernetesClientConfigMapPropertySourceLocator (coreV1Api , configMapConfigProperties ,
234238 namespaceProvider );
0 commit comments