@@ -226,10 +226,17 @@ const (
226226)
227227
228228const (
229+ // ServicePrefix is the prefix for references pointing to a service
230+ ServicePrefix = "service:"
231+ // ContainerPrefix is the prefix for references pointing to a container
232+ ContainerPrefix = "container:"
233+
229234 // NetworkModeServicePrefix is the prefix for network_mode pointing to a service
230- NetworkModeServicePrefix = "service:"
235+ // Deprecated prefer ServicePrefix
236+ NetworkModeServicePrefix = ServicePrefix
231237 // NetworkModeContainerPrefix is the prefix for network_mode pointing to a container
232- NetworkModeContainerPrefix = "container:"
238+ // Deprecated prefer ContainerPrefix
239+ NetworkModeContainerPrefix = ContainerPrefix
233240)
234241
235242// GetDependencies retrieve all services this service depends on
@@ -246,9 +253,21 @@ func (s ServiceConfig) GetDependencies() []string {
246253 dependencies .append (link )
247254 }
248255 }
249- if strings .HasPrefix (s .NetworkMode , NetworkModeServicePrefix ) {
250- dependencies .append (s .NetworkMode [len (NetworkModeServicePrefix ):])
256+ if strings .HasPrefix (s .NetworkMode , ServicePrefix ) {
257+ dependencies .append (s .NetworkMode [len (ServicePrefix ):])
258+ }
259+ if strings .HasPrefix (s .Ipc , ServicePrefix ) {
260+ dependencies .append (s .Ipc [len (ServicePrefix ):])
261+ }
262+ if strings .HasPrefix (s .Pid , ServicePrefix ) {
263+ dependencies .append (s .Pid [len (ServicePrefix ):])
251264 }
265+ for _ , vol := range s .VolumesFrom {
266+ if ! strings .HasPrefix (s .Pid , ContainerPrefix ) {
267+ dependencies .append (vol )
268+ }
269+ }
270+
252271 return dependencies .toSlice ()
253272}
254273
0 commit comments