Skip to content

Commit 54178e3

Browse files
authored
Merge branch 'main' into dependabot/maven/main/io.fabric8-kubernetes-client-bom-7.4.0
Signed-off-by: Ryan Baxter <[email protected]>
2 parents 81cc862 + bd8d05b commit 54178e3

File tree

54 files changed

+328
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+328
-269
lines changed

.github/workflows/maven.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
uses: ./.github/workflows/composites/cache
4242

4343
- name: Show caches
44-
uses: actions/github-script@v7
44+
uses: actions/github-script@v8
4545
with:
4646
script: |
4747
const caches = await github.rest.actions.getActionsCacheList({

docs/modules/ROOT/pages/property-source-config/configmap-propertysource.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,12 @@ If you want your application to fail the start-up process in such cases, you can
575575

576576
[#config-map-retry]
577577
You can also make your application retry loading `ConfigMap` property sources on a failure. First, you need to
578-
set `spring.cloud.kubernetes.config.fail-fast=true`. Then you need to add `spring-retry`
579-
and `spring-boot-starter-aop` to your classpath. You can configure retry properties such as
578+
set `spring.cloud.kubernetes.config.fail-fast=true`. Then you need to add `spring-retry`
579+
and `spring-boot-starter-aspectj` to your classpath. You can configure retry properties such as
580580
the maximum number of attempts, backoff options like initial interval, multiplier, max interval by setting the
581581
`spring.cloud.kubernetes.config.retry.*` properties.
582582

583-
NOTE: If you already have `spring-retry` and `spring-boot-starter-aop` on the classpath for some reason
583+
NOTE: If you already have `spring-retry` and `spring-boot-starter-aspectj` on the classpath for some reason
584584
and want to enable fail-fast, but do not want retry to be enabled; you can disable retry for `ConfigMap` `PropertySources`
585585
by setting `spring.cloud.kubernetes.config.retry.enabled=false`.
586586

docs/modules/ROOT/pages/property-source-config/secrets-propertysource.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ When enabled, the `Fabric8SecretsPropertySource` looks up Kubernetes for `Secret
1111
. Named after the application (as defined by `spring.application.name`)
1212
. Matching some labels
1313

14-
*Note:*
14+
*Note:*
1515

1616
By default, consuming Secrets through the API (points 2 and 3 above) *is not enabled* for security reasons. The permission 'list' on secrets allows clients to inspect secrets values in the specified namespace.
1717
Further, we recommend that containers share secrets through mounted volumes.
1818

19-
If you enable consuming Secrets through the API, we recommend that you limit access to Secrets by using an authorization policy, such as RBAC.
19+
If you enable consuming Secrets through the API, we recommend that you limit access to Secrets by using an authorization policy, such as RBAC.
2020
For more information about risks and best practices when consuming Secrets through the API refer to https://kubernetes.io/docs/concepts/configuration/secret/#best-practices[this doc].
2121

2222
If the secrets are found, their data is made available to the application.
@@ -135,16 +135,16 @@ the `Secret` named `s1` would be looked up in the namespace that the application
135135
See xref:property-source-config/namespace-resolution.adoc[namespace-resolution] to get a better understanding of how the namespace
136136
of the application is resolved.
137137

138-
xref:property-source-config/configmap-propertysource.adoc#config-map-fail-fast[Similar to the `ConfigMaps`]; if you want your application to fail to start
138+
xref:property-source-config/configmap-propertysource.adoc#config-map-fail-fast[Similar to the `ConfigMaps`]; if you want your application to fail to start
139139
when it is unable to load `Secrets` property sources, you can set `spring.cloud.kubernetes.secrets.fail-fast=true`.
140140

141141
It is also possible to enable retry for `Secret` property sources xref:property-source-config/configmap-propertysource.adoc#config-map-retry[like the `ConfigMaps`].
142-
As with the `ConfigMap` property sources, first you need to set `spring.cloud.kubernetes.secrets.fail-fast=true`.
143-
Then you need to add `spring-retry` and `spring-boot-starter-aop` to your classpath.
142+
As with the `ConfigMap` property sources, first you need to set `spring.cloud.kubernetes.secrets.fail-fast=true`.
143+
Then you need to add `spring-retry` and `spring-boot-starter-aspectj` to your classpath.
144144
Retry behavior of the `Secret` property sources can be configured by setting the `spring.cloud.kubernetes.secrets.retry.*`
145145
properties.
146146

147-
NOTE: If you already have `spring-retry` and `spring-boot-starter-aop` on the classpath for some reason
147+
NOTE: If you already have `spring-retry` and `spring-boot-starter-aspectj` on the classpath for some reason
148148
and want to enable fail-fast, but do not want retry to be enabled; you can disable retry for `Secrets` `PropertySources`
149149
by setting `spring.cloud.kubernetes.secrets.retry.enabled=false`.
150150

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dependencies": {
33
"antora": "3.2.0-alpha.9",
4-
"@antora/atlas-extension": "1.0.0-alpha.2",
4+
"@antora/atlas-extension": "1.0.0-alpha.5",
55
"@antora/collector-extension": "1.0.2",
66
"@asciidoctor/tabs": "1.0.0-beta.6",
77
"@springio/antora-extensions": "1.14.7",

spring-cloud-kubernetes-client-autoconfig/src/main/java/org/springframework/cloud/kubernetes/client/KubernetesClientPodUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private V1Pod internalGetPod() {
104104
if (isServiceHostEnvVarPresent() && isHostNameEnvVarPresent() && isServiceAccountFound()) {
105105
LOG.debug("reading pod in namespace : " + namespace);
106106
// The hostname of your pod is typically also its name.
107-
return client.readNamespacedPod(hostName, namespace, null);
107+
return client.readNamespacedPod(hostName, namespace).execute();
108108
}
109109
}
110110
catch (Throwable t) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
org.springframework.boot.env.EnvironmentPostProcessor=\
1+
org.springframework.boot.EnvironmentPostProcessor=\
22
org.springframework.cloud.kubernetes.client.profile.KubernetesClientProfileEnvironmentPostProcessor

spring-cloud-kubernetes-client-autoconfig/src/test/java/org/springframework/cloud/kubernetes/client/ActuatorEnabledFailFastExceptionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void afterEach() {
6969
void test() throws ApiException {
7070
Health health = healthIndicator.health(true);
7171
Assertions.assertThat(Status.DOWN).isSameAs(health.getStatus());
72-
Mockito.verify(coreV1Api).readNamespacedPod("host", "my-namespace", null);
72+
Mockito.verify(coreV1Api).readNamespacedPod("host", "my-namespace");
7373
}
7474

7575
private static void mocks() {
@@ -103,7 +103,7 @@ KubernetesClientPodUtils kubernetesPodUtils() throws ApiException {
103103

104104
mocks();
105105

106-
Mockito.when(coreV1Api.readNamespacedPod("host", "my-namespace", null))
106+
Mockito.when(coreV1Api.readNamespacedPod("host", "my-namespace"))
107107
.thenThrow(new RuntimeException("just because"));
108108

109109
return new KubernetesClientPodUtils(coreV1Api, "my-namespace", FAIL_FAST);

spring-cloud-kubernetes-client-autoconfig/src/test/java/org/springframework/cloud/kubernetes/client/ActuatorEnabledNoFailFastExceptionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void afterEach() {
7272
void test() throws ApiException {
7373
Health health = healthIndicator.health(true);
7474
Assertions.assertThat(Status.UP).isSameAs(health.getStatus());
75-
Mockito.verify(coreV1Api).readNamespacedPod("host", "my-namespace", null);
75+
Mockito.verify(coreV1Api).readNamespacedPod("host", "my-namespace");
7676
}
7777

7878
private static void mocks() {
@@ -106,7 +106,7 @@ KubernetesClientPodUtils kubernetesPodUtils() throws ApiException {
106106

107107
mocks();
108108

109-
Mockito.when(coreV1Api.readNamespacedPod("host", "my-namespace", null))
109+
Mockito.when(coreV1Api.readNamespacedPod("host", "my-namespace"))
110110
.thenThrow(new RuntimeException("just because"));
111111

112112
return new KubernetesClientPodUtils(coreV1Api, "my-namespace", FAIL_FAST);

spring-cloud-kubernetes-client-autoconfig/src/test/java/org/springframework/cloud/kubernetes/client/KubernetesClientPodUtilsTests.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
import static org.assertj.core.api.Assertions.assertThat;
3737
import static org.assertj.core.api.Assertions.assertThatThrownBy;
38+
import static org.mockito.Mockito.mock;
39+
import static org.mockito.Mockito.when;
3840

3941
/**
4042
* @author wind57
@@ -55,15 +57,15 @@ class KubernetesClientPodUtilsTests {
5557

5658
private static final V1Pod POD = new V1Pod();
5759

58-
private final CoreV1Api client = Mockito.mock(CoreV1Api.class);
60+
private final CoreV1Api client = mock(CoreV1Api.class);
5961

60-
private final Path tokenPath = Mockito.mock(Path.class);
62+
private final Path tokenPath = mock(Path.class);
6163

62-
private final File tokenFile = Mockito.mock(File.class);
64+
private final File tokenFile = mock(File.class);
6365

64-
private final Path certPath = Mockito.mock(Path.class);
66+
private final Path certPath = mock(Path.class);
6567

66-
private final File certFile = Mockito.mock(File.class);
68+
private final File certFile = mock(File.class);
6769

6870
private MockedStatic<EnvReader> envReader;
6971

@@ -156,19 +158,21 @@ private void mockHostname(String name) {
156158
}
157159

158160
private void mockTokenPath(boolean result) {
159-
Mockito.when(tokenPath.toFile()).thenReturn(tokenFile);
160-
Mockito.when(tokenFile.exists()).thenReturn(result);
161+
when(tokenPath.toFile()).thenReturn(tokenFile);
162+
when(tokenFile.exists()).thenReturn(result);
161163
paths.when(() -> Paths.get(SERVICE_ACCOUNT_TOKEN_PATH)).thenReturn(tokenPath);
162164
}
163165

164166
private void mockCertPath(boolean result) {
165-
Mockito.when(certPath.toFile()).thenReturn(certFile);
166-
Mockito.when(certFile.exists()).thenReturn(result);
167+
when(certPath.toFile()).thenReturn(certFile);
168+
when(certFile.exists()).thenReturn(result);
167169
paths.when(() -> Paths.get(SERVICE_ACCOUNT_CERT_PATH)).thenReturn(certPath);
168170
}
169171

170172
private void mockPodResult() throws ApiException {
171-
Mockito.when(client.readNamespacedPod(POD_HOSTNAME, "namespace", null)).thenReturn(POD);
173+
CoreV1Api.APIreadNamespacedPodRequest request = mock(CoreV1Api.APIreadNamespacedPodRequest.class);
174+
when(request.execute()).thenReturn(POD);
175+
when(client.readNamespacedPod(POD_HOSTNAME, "namespace")).thenReturn(request);
172176
}
173177

174178
}

spring-cloud-kubernetes-client-config/pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@
5959
<artifactId>spring-retry</artifactId>
6060
<optional>true</optional>
6161
</dependency>
62-
<dependency>
63-
<groupId>org.springframework.boot</groupId>
64-
<artifactId>spring-boot-starter-aop</artifactId>
65-
<optional>true</optional>
66-
</dependency>
67-
6862
<dependency>
6963
<groupId>org.springframework.boot</groupId>
7064
<artifactId>spring-boot-health</artifactId>
@@ -107,7 +101,7 @@
107101
</dependency>
108102
<dependency>
109103
<groupId>org.springframework.boot</groupId>
110-
<artifactId>spring-boot-starter-aop</artifactId>
104+
<artifactId>spring-boot-starter-aspectj</artifactId>
111105
<scope>test</scope>
112106
</dependency>
113107
<dependency>

0 commit comments

Comments
 (0)