Skip to content

Commit

Permalink
Set 'mountSources' to 'true' in some example SpringBoot multi-contain…
Browse files Browse the repository at this point in the history
…er Devfiles (#6761)

In those examples, the build and run commands are running in
different container components.
Without mounting sources in the container used for the 'run' command,
this command will not start because Maven would not be able
to resolve the 'spring-boot' plugin:

```
 ✓  Building your application in container (command: defaultbuild) [39s]
 •  Executing the application (command: defaultrun)  ...
 ✗  Finished executing the application (command: defaultrun) [151ms]
 ⚠  Devfile command "defaultrun" exited with an error status in 20 second(s)
 ⚠  Last 100 lines of log:
 ✗  Waiting for the application to be ready [1m]
 ⚠  Port forwarding might not work correctly: timeout while checking for ports; ports not listening: (8080 in container "runtime"): context deadline exceeded
 ⚠  Running `odo logs --follow` might help in identifying the problem.

 -  Forwarding from 127.0.0.1:20001 -> 8080
```

This was not caught in the tests because failing to run the
'run' command current does not prevent the Dev session from starting.

This change might actually make the test faster as we would not have to wait 1 minute
to find out that the application port is not reachable.
  • Loading branch information
rm3l authored Apr 24, 2023
1 parent 1cfc8b6 commit f62a433
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ components:
volumeMounts:
- name: springbootpvc
path: /data/cache/.m2
mountSources: false
mountSources: true
- name: springbootpvc
volume:
ephemeral: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ components:
volumeMounts:
- name: springbootpvc
path: /data/cache/.m2
mountSources: false
mountSources: true
- name: springbootpvc
volume:
ephemeral: true
Expand Down

0 comments on commit f62a433

Please sign in to comment.