Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void namedSingleConfigMapFails(CapturedOutput output) {

stubFor(get(path).willReturn(aResponse().withStatus(500).withBody("Internal Server Error")));

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(), Map.of(), true,
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(), Map.of(),
name, namespace, false, true, false, RetryProperties.DEFAULT, ReadType.BATCH);

CoreV1Api api = new CoreV1Api();
Expand Down Expand Up @@ -152,9 +152,9 @@ void namedTwoConfigMapsOneFails(CapturedOutput output) {
ConfigMapConfigProperties.Source sourceTwo = new ConfigMapConfigProperties.Source(configMapNameTwo, namespace,
Map.of(), null, null, null);

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(
List.of(sourceOne, sourceTwo), Map.of(), true, null, namespace, false, true, false,
RetryProperties.DEFAULT, ReadType.BATCH);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true,
List.of(sourceOne, sourceTwo), Map.of(), null, namespace, false, true, false, RetryProperties.DEFAULT,
ReadType.BATCH);

CoreV1Api api = new CoreV1Api();
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
Expand Down Expand Up @@ -199,9 +199,9 @@ void namedTwoConfigMapsBothFail(CapturedOutput output) {
ConfigMapConfigProperties.Source sourceTwo = new ConfigMapConfigProperties.Source(configMapNameTwo, namespace,
Map.of(), null, null, null);

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(
List.of(sourceOne, sourceTwo), Map.of(), true, null, namespace, false, true, false,
RetryProperties.DEFAULT, ReadType.BATCH);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true,
List.of(sourceOne, sourceTwo), Map.of(), null, namespace, false, true, false, RetryProperties.DEFAULT,
ReadType.BATCH);

CoreV1Api api = new CoreV1Api();
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
Expand Down Expand Up @@ -243,8 +243,9 @@ void labeledSingleConfigMapFails(CapturedOutput output) {
ConfigMapConfigProperties.Source configMapSource = new ConfigMapConfigProperties.Source(null, namespace, labels,
null, null, null);

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(configMapSource),
labels, true, null, namespace, false, true, false, RetryProperties.DEFAULT, ReadType.BATCH);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true,
List.of(configMapSource), labels, null, namespace, false, true, false, RetryProperties.DEFAULT,
ReadType.BATCH);

CoreV1Api api = new CoreV1Api();
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
Expand Down Expand Up @@ -294,9 +295,9 @@ void labeledTwoConfigMapsOneFails(CapturedOutput output) {
ConfigMapConfigProperties.Source sourceTwo = new ConfigMapConfigProperties.Source(null, namespace,
configMapTwoLabels, null, null, null);

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(
List.of(sourceOne, sourceTwo), Map.of("one", "1", "two", "2"), true, null, namespace, false, true,
false, RetryProperties.DEFAULT, ReadType.BATCH);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true,
List.of(sourceOne, sourceTwo), Map.of("one", "1", "two", "2"), null, namespace, false, true, false,
RetryProperties.DEFAULT, ReadType.BATCH);

CoreV1Api api = new CoreV1Api();
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
Expand Down Expand Up @@ -348,9 +349,9 @@ void labeledTwoConfigMapsBothFail(CapturedOutput output) {
ConfigMapConfigProperties.Source sourceTwo = new ConfigMapConfigProperties.Source(null, namespace,
configMapTwoLabels, null, null, null);

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(
List.of(sourceOne, sourceTwo), Map.of("one", "1", "two", "2"), true, null, namespace, false, true,
false, RetryProperties.DEFAULT, ReadType.BATCH);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true,
List.of(sourceOne, sourceTwo), Map.of("one", "1", "two", "2"), null, namespace, false, true, false,
RetryProperties.DEFAULT, ReadType.BATCH);

CoreV1Api api = new CoreV1Api();
KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void locateWithoutSources() {
CoreV1Api api = new CoreV1Api();
stubFor(get("/api/v1/namespaces/default/configmaps")
.willReturn(aResponse().withStatus(200).withBody(JSON.serialize(PROPERTIES_CONFIGMAP_LIST))));
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(), Map.of(), true,
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(), Map.of(),
"bootstrap-640", null, false, false, false, RetryProperties.DEFAULT, ReadType.BATCH);
MockEnvironment mockEnvironment = new MockEnvironment();
mockEnvironment.setProperty("spring.cloud.kubernetes.client.namespace", "default");
Expand All @@ -125,8 +125,8 @@ void locateWithSources() {

ConfigMapConfigProperties.Source source = new ConfigMapConfigProperties.Source("bootstrap-640", "default",
Collections.emptyMap(), null, null, null);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(source), Map.of(),
true, "fake-name", null, false, false, false, RetryProperties.DEFAULT, ReadType.BATCH);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(source),
Map.of(), "fake-name", null, false, false, false, RetryProperties.DEFAULT, ReadType.BATCH);

PropertySource<?> propertySource = new KubernetesClientConfigMapPropertySourceLocator(api,
configMapConfigProperties, new KubernetesNamespaceProvider(new MockEnvironment()))
Expand All @@ -148,7 +148,7 @@ void testLocateWithoutNamespaceConstructor() {
stubFor(get("/api/v1/namespaces/default/configmaps")
.willReturn(aResponse().withStatus(200).withBody(JSON.serialize(PROPERTIES_CONFIGMAP_LIST))));

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(), Map.of(), true,
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(), Map.of(),
"bootstrap-640", null, false, false, false, RetryProperties.DEFAULT, ReadType.BATCH);

assertThatThrownBy(() -> new KubernetesClientConfigMapPropertySourceLocator(api, configMapConfigProperties,
Expand All @@ -168,7 +168,7 @@ void testLocateWithoutNamespace() {
CoreV1Api api = new CoreV1Api();
stubFor(get("/api/v1/namespaces/default/configmaps")
.willReturn(aResponse().withStatus(200).withBody(JSON.serialize(PROPERTIES_CONFIGMAP_LIST))));
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(), Map.of(), true,
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(), Map.of(),
"bootstrap-640", null, false, false, false, RetryProperties.DEFAULT, ReadType.BATCH);
assertThatThrownBy(() -> new KubernetesClientConfigMapPropertySourceLocator(api, configMapConfigProperties,
new KubernetesNamespaceProvider(ENV))
Expand All @@ -181,7 +181,7 @@ public void locateShouldThrowExceptionOnFailureWhenFailFastIsEnabled() {
stubFor(get("/api/v1/namespaces/default/configmaps")
.willReturn(aResponse().withStatus(500).withBody("Internal Server Error")));

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(), Map.of(), true,
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(), Map.of(),
"bootstrap-640", "default", false, false, true, RetryProperties.DEFAULT, ReadType.BATCH);

KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
Expand All @@ -197,7 +197,7 @@ public void locateShouldNotThrowExceptionOnFailureWhenFailFastIsDisabled(Capture
stubFor(get("/api/v1/namespaces/default/configmaps")
.willReturn(aResponse().withStatus(500).withBody("Internal Server Error")));

ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(), Map.of(), true,
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(), Map.of(),
"bootstrap-640", "default", false, false, false, RetryProperties.DEFAULT, ReadType.BATCH);

KubernetesClientConfigMapPropertySourceLocator locator = new KubernetesClientConfigMapPropertySourceLocator(api,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ void getLocateWithSources() {
SecretsConfigProperties.Source source2 = new SecretsConfigProperties.Source("rabbit-password", "",
Collections.emptyMap(), null, null, null);

SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(Map.of(),
List.of(source1, source2), true, "app", "default", false, true, false, RetryProperties.DEFAULT,
ReadType.BATCH);
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, List.of(source1, source2),
Map.of(), "app", "default", false, true, false, RetryProperties.DEFAULT, ReadType.BATCH);

PropertySource<?> propertySource = new KubernetesClientSecretsPropertySourceLocator(api,
new KubernetesNamespaceProvider(new MockEnvironment()), secretsConfigProperties)
Expand All @@ -162,7 +161,7 @@ void getLocateWithSources() {
void getLocateWithOutSources() {
CoreV1Api api = new CoreV1Api();
stubFor(get(LIST_API).willReturn(aResponse().withStatus(200).withBody(LIST_BODY)));
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(Map.of(), List.of(), true,
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, List.of(), Map.of(),
"db-secret", "default", false, true, false, RetryProperties.DEFAULT, ReadType.BATCH);

PropertySource<?> propertySource = new KubernetesClientSecretsPropertySourceLocator(api,
Expand All @@ -184,7 +183,7 @@ void testLocateWithoutNamespaceConstructor() {
CoreV1Api api = new CoreV1Api();
stubFor(get(LIST_API).willReturn(aResponse().withStatus(200).withBody(LIST_BODY)));

SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(Map.of(), List.of(), true,
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, List.of(), Map.of(),
"db-secret", "", false, true, false, RetryProperties.DEFAULT, ReadType.BATCH);

assertThatThrownBy(() -> new KubernetesClientSecretsPropertySourceLocator(api,
Expand All @@ -197,7 +196,7 @@ void locateShouldThrowExceptionOnFailureWhenFailFastIsEnabled() {
CoreV1Api api = new CoreV1Api();
stubFor(get(LIST_API).willReturn(aResponse().withStatus(500).withBody("Internal Server Error")));

SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(Map.of(), List.of(), true,
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, List.of(), Map.of(),
"db-secret", "default", false, true, true, RetryProperties.DEFAULT, ReadType.BATCH);

KubernetesClientSecretsPropertySourceLocator locator = new KubernetesClientSecretsPropertySourceLocator(api,
Expand All @@ -212,7 +211,7 @@ void locateShouldNotThrowExceptionOnFailureWhenFailFastIsDisabled(CapturedOutput
CoreV1Api api = new CoreV1Api();
stubFor(get(LIST_API).willReturn(aResponse().withStatus(500).withBody("Internal Server Error")));

SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(Map.of(), List.of(), true,
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, List.of(), Map.of(),
"db-secret", "default", false, true, false, RetryProperties.DEFAULT, ReadType.BATCH);

KubernetesClientSecretsPropertySourceLocator locator = new KubernetesClientSecretsPropertySourceLocator(api,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ AbstractEnvironment environment() {
// simulate that environment already has a
// KubernetesClientConfigMapPropertySource,
// otherwise we can't properly test reload functionality
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(), Map.of(),
true, CONFIG_MAP_NAME, NAMESPACE, false, true, FAIL_FAST, RetryProperties.DEFAULT, ReadType.BATCH);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
Map.of(), CONFIG_MAP_NAME, NAMESPACE, false, true, FAIL_FAST, RetryProperties.DEFAULT,
ReadType.BATCH);
KubernetesNamespaceProvider namespaceProvider = new KubernetesNamespaceProvider(mockEnvironment);

PropertySource<?> propertySource = new KubernetesClientConfigMapPropertySourceLocator(coreV1Api,
Expand All @@ -239,7 +240,7 @@ ConfigReloadProperties configReloadProperties() {
@Bean
@Primary
ConfigMapConfigProperties configMapConfigProperties() {
return new ConfigMapConfigProperties(List.of(), Map.of(), true, CONFIG_MAP_NAME, NAMESPACE, false, true,
return new ConfigMapConfigProperties(true, List.of(), Map.of(), CONFIG_MAP_NAME, NAMESPACE, false, true,
FAIL_FAST, RetryProperties.DEFAULT, ReadType.BATCH);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ AbstractEnvironment environment() {
V1Secret secret = secret(SECRET_NAME, Map.of());
V1SecretList secretList = new V1SecretList().addItemsItem(secret);

stubFor(get(PATH).willReturn(aResponse().withStatus(200).withBody(new JSON().serialize(secretList)))
stubFor(get(PATH).willReturn(aResponse().withStatus(200).withBody(JSON.serialize(secretList)))
.inScenario(SCENARIO_NAME)
.whenScenarioStateIs(Scenario.STARTED)
.willSetStateTo("go-to-fail"));
Expand All @@ -221,7 +221,7 @@ AbstractEnvironment environment() {
// simulate that environment already has a
// KubernetesClientConfigMapPropertySource,
// otherwise we can't properly test reload functionality
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(Map.of(), List.of(), true,
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, List.of(), Map.of(),
SECRET_NAME, NAMESPACE, false, true, FAIL_FAST, RetryProperties.DEFAULT, ReadType.BATCH);
KubernetesNamespaceProvider namespaceProvider = new KubernetesNamespaceProvider(mockEnvironment);

Expand All @@ -244,7 +244,7 @@ ConfigReloadProperties configReloadProperties() {
@Bean
@Primary
SecretsConfigProperties secretsConfigProperties() {
return new SecretsConfigProperties(Map.of(), List.of(), true, SECRET_NAME, NAMESPACE, false, true,
return new SecretsConfigProperties(true, List.of(), Map.of(), SECRET_NAME, NAMESPACE, false, true,
FAIL_FAST, RetryProperties.DEFAULT, ReadType.BATCH);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ AbstractEnvironment environment() {
// simulate that environment already has a
// KubernetesClientConfigMapPropertySource,
// otherwise we can't properly test reload functionality
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(List.of(), Map.of(),
true, CONFIG_MAP_NAME, NAMESPACE, false, true, true, RetryProperties.DEFAULT, ReadType.BATCH);
ConfigMapConfigProperties configMapConfigProperties = new ConfigMapConfigProperties(true, List.of(),
Map.of(), CONFIG_MAP_NAME, NAMESPACE, false, true, true, RetryProperties.DEFAULT, ReadType.BATCH);
KubernetesNamespaceProvider namespaceProvider = new KubernetesNamespaceProvider(mockEnvironment);

PropertySource<?> propertySource = new KubernetesClientConfigMapPropertySourceLocator(coreV1Api,
Expand All @@ -215,7 +215,7 @@ ConfigReloadProperties configReloadProperties() {
@Bean
@Primary
ConfigMapConfigProperties configMapConfigProperties() {
return new ConfigMapConfigProperties(List.of(), Map.of(), true, CONFIG_MAP_NAME, NAMESPACE, false, true,
return new ConfigMapConfigProperties(true, List.of(), Map.of(), CONFIG_MAP_NAME, NAMESPACE, false, true,
FAIL_FAST, RetryProperties.DEFAULT, ReadType.BATCH);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ AbstractEnvironment environment() {
// simulate that environment already has a
// KubernetesClientSecretPropertySource,
// otherwise we can't properly test reload functionality
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(Map.of(), List.of(), true,
SecretsConfigProperties secretsConfigProperties = new SecretsConfigProperties(true, List.of(), Map.of(),
SECRET_NAME, NAMESPACE, false, true, false, RetryProperties.DEFAULT, ReadType.BATCH);
KubernetesNamespaceProvider namespaceProvider = new KubernetesNamespaceProvider(mockEnvironment);

Expand All @@ -217,7 +217,7 @@ ConfigReloadProperties configReloadProperties() {
@Bean
@Primary
SecretsConfigProperties secretsConfigProperties() {
return new SecretsConfigProperties(Map.of(), List.of(), true, SECRET_NAME, NAMESPACE, false, true,
return new SecretsConfigProperties(true, List.of(), Map.of(), SECRET_NAME, NAMESPACE, false, true,
FAIL_FAST, RetryProperties.DEFAULT, ReadType.BATCH);
}

Expand Down
Loading
Loading