Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/compose/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,11 @@ func loadDevelopmentConfig(service types.ServiceConfig, project *types.Project)

func checkIfPathAlreadyBindMounted(watchPath string, volumes []types.ServiceVolumeConfig) bool {
for _, volume := range volumes {
if volume.Bind != nil && strings.HasPrefix(watchPath, volume.Source) {
return true
if volume.Bind != nil {
relPath, err := filepath.Rel(volume.Source, watchPath)
if err == nil && !strings.HasPrefix(relPath, "..") {
return true
}
}
}
return false
Expand Down
3 changes: 3 additions & 0 deletions pkg/e2e/fixtures/watch/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ services:
RUN mkdir -p /app/config
init: true
command: sleep infinity
volumes:
- ./dat:/app/dat
- ./data-logs:/app/data-logs
develop: *x-dev
1 change: 1 addition & 0 deletions pkg/e2e/fixtures/watch/dat/meow.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
i am a wannabe cat
1 change: 1 addition & 0 deletions pkg/e2e/fixtures/watch/data-logs/server.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[INFO] Server started successfully on port 8080
Loading