You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow docker compose service readiness checks to be bypassed
Add `spring.docker.compose.readiness.wait` property that can be used to
determine how Spring Boot should wait for docker compose services to
become ready.
Fixesgh-35545
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/lifecycle/DockerComposeLifecycleManager.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/lifecycle/DockerComposeProperties.java
+36
Original file line number
Diff line number
Diff line change
@@ -244,6 +244,11 @@ public void setInTests(boolean inTests) {
244
244
*/
245
245
publicstaticclassReadiness {
246
246
247
+
/**
248
+
* Wait strategy to use.
249
+
*/
250
+
privateWaitwait = Wait.ALWAYS;
251
+
247
252
/**
248
253
* Timeout of the readiness checks.
249
254
*/
@@ -254,6 +259,14 @@ public static class Readiness {
254
259
*/
255
260
privatefinalTcptcp = newTcp();
256
261
262
+
publicWaitgetWait() {
263
+
returnthis.wait;
264
+
}
265
+
266
+
publicvoidsetWait(Waitwait) {
267
+
this.wait = wait;
268
+
}
269
+
257
270
publicDurationgetTimeout() {
258
271
returnthis.timeout;
259
272
}
@@ -266,6 +279,29 @@ public Tcp getTcp() {
266
279
returnthis.tcp;
267
280
}
268
281
282
+
/**
283
+
* Readiness wait strategies.
284
+
*/
285
+
publicenumWait {
286
+
287
+
/**
288
+
* Always perform readiness checks.
289
+
*/
290
+
ALWAYS,
291
+
292
+
/**
293
+
* Always perform readiness checks.
294
+
*/
295
+
NEVER,
296
+
297
+
/**
298
+
* Only perform readiness checks if docker was started with lifecycle
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/lifecycle/DockerComposeLifecycleManagerTests.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/lifecycle/DockerComposePropertiesTests.java
0 commit comments