Skip to content

Commit f98c7c6

Browse files
authored
Merge branch 'main' into compose-up-close-panic
2 parents 291b3d2 + 4ae2e0e commit f98c7c6

File tree

3 files changed

+33
-22
lines changed

3 files changed

+33
-22
lines changed

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ require (
1111
github.com/containerd/console v1.0.4
1212
github.com/containerd/containerd v1.7.13
1313
github.com/davecgh/go-spew v1.1.1
14-
github.com/distribution/reference v0.5.0
14+
github.com/distribution/reference v0.6.0
1515
github.com/docker/buildx v0.13.1
16-
github.com/docker/cli v26.0.0+incompatible
16+
github.com/docker/cli v26.0.1+incompatible
1717
github.com/docker/cli-docs-tool v0.7.0
18-
github.com/docker/docker v26.0.0+incompatible
18+
github.com/docker/docker v26.0.1+incompatible
1919
github.com/docker/go-connections v0.5.0
2020
github.com/docker/go-units v0.5.0
2121
github.com/fsnotify/fsevents v0.1.1
@@ -38,7 +38,7 @@ require (
3838
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3939
github.com/spf13/cobra v1.8.0
4040
github.com/spf13/pflag v1.0.5
41-
github.com/stretchr/testify v1.8.4
41+
github.com/stretchr/testify v1.9.0
4242
github.com/theupdateframework/notary v0.7.0
4343
github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375
4444
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
@@ -50,7 +50,7 @@ require (
5050
go.uber.org/goleak v1.3.0
5151
go.uber.org/mock v0.4.0
5252
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
53-
golang.org/x/sync v0.6.0
53+
golang.org/x/sync v0.7.0
5454
golang.org/x/sys v0.16.0
5555
google.golang.org/grpc v1.59.0
5656
gopkg.in/yaml.v3 v3.0.1

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,19 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
122122
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
123123
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
124124
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
125-
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
126-
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
125+
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
126+
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
127127
github.com/docker/buildx v0.13.1 h1:uZjBcb477zh02tnHk0rqNV/DZOxbf/OiHw6Mc8OhDYU=
128128
github.com/docker/buildx v0.13.1/go.mod h1:f2n6vggoX4sNNZ0XoRZ0Wtv6J1/rbDTabgdHtpW9NNM=
129-
github.com/docker/cli v26.0.0+incompatible h1:90BKrx1a1HKYpSnnBFR6AgDq/FqkHxwlUyzJVPxD30I=
130-
github.com/docker/cli v26.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
129+
github.com/docker/cli v26.0.1+incompatible h1:eZDuplk2jYqgUkNLDYwTBxqmY9cM3yHnmN6OIUEjL3U=
130+
github.com/docker/cli v26.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
131131
github.com/docker/cli-docs-tool v0.7.0 h1:M2Da98Unz2kz3A5d4yeSGbhyOge2mfYSNjAFt01Rw0M=
132132
github.com/docker/cli-docs-tool v0.7.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
133133
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
134134
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
135135
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
136-
github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU=
137-
github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
136+
github.com/docker/docker v26.0.1+incompatible h1:t39Hm6lpXuXtgkF0dm1t9a5HkbUfdGy6XbWexmGr+hA=
137+
github.com/docker/docker v26.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
138138
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
139139
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
140140
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
@@ -474,8 +474,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
474474
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
475475
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
476476
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
477-
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
478-
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
477+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
478+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
479479
github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c=
480480
github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw=
481481
github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375 h1:QB54BJwA6x8QU9nHY3xJSZR2kX9bgpZekRKGkLTmEXA=
@@ -588,8 +588,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
588588
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
589589
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
590590
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
591-
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
592-
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
591+
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
592+
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
593593
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
594594
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
595595
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

pkg/compose/create.go

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,25 @@ func (s *composeService) ensureProjectVolumes(ctx context.Context, project *type
167167
if !filepath.IsAbs(p) {
168168
return fmt.Errorf("file share path is not absolute: %s", p)
169169
}
170-
if _, err := os.Stat(p); errors.Is(err, fs.ErrNotExist) {
170+
if fi, err := os.Stat(p); errors.Is(err, fs.ErrNotExist) {
171+
// actual directory will be implicitly created when the
172+
// file share is initialized if it doesn't exist, so
173+
// need to filter out any that should not be auto-created
171174
if vol.Bind != nil && !vol.Bind.CreateHostPath {
172-
return fmt.Errorf("service %s: host path %q does not exist and `create_host_path` is false", svcName, vol.Source)
173-
}
174-
if err := os.MkdirAll(p, 0o755); err != nil {
175-
return fmt.Errorf("creating host path: %w", err)
175+
logrus.Debugf("Skipping creating file share for %q: does not exist and `create_host_path` is false", p)
176+
continue
176177
}
178+
} else if err != nil {
179+
// if we can't read the path, we won't be able ot make
180+
// a file share for it
181+
logrus.Debugf("Skipping creating file share for %q: %v", p, err)
182+
continue
183+
} else if !fi.IsDir() {
184+
// ignore files & special types (e.g. Unix sockets)
185+
logrus.Debugf("Skipping creating file share for %q: not a directory", p)
186+
continue
177187
}
188+
178189
paths = append(paths, p)
179190
}
180191
}
@@ -185,14 +196,14 @@ func (s *composeService) ensureProjectVolumes(ctx context.Context, project *type
185196

186197
fileShareManager := desktop.NewFileShareManager(s.desktopCli, project.Name, paths)
187198
if err := fileShareManager.EnsureExists(ctx); err != nil {
188-
return fmt.Errorf("initializing: %w", err)
199+
return fmt.Errorf("initializing file shares: %w", err)
189200
}
190201
}
191202
return nil
192203
}()
193204

194205
if err != nil {
195-
progress.ContextWriter(ctx).TailMsgf("Failed to prepare Synchronized File Shares: %v", err)
206+
progress.ContextWriter(ctx).TailMsgf("Failed to prepare Synchronized file shares: %v", err)
196207
}
197208
return nil
198209
}

0 commit comments

Comments
 (0)