@@ -321,12 +321,10 @@ func mountsToLayerAndParents(mounts []mount.Mount) (string, []string, error) {
321321 }
322322 mnt := mounts [0 ]
323323
324- if mnt .Type != "windows-layer" && mnt . Type != "bind" {
324+ if mnt .Type != "windows-layer" {
325325 // This is a special case error. When this is received the diff service
326326 // will attempt the next differ in the chain which for Windows is the
327327 // lcow differ that we want.
328- // TODO: Is there any situation where we actually wanted a "bind" mount to
329- // fall through to the lcow differ?
330328 return "" , nil , fmt .Errorf ("windowsDiff does not support layer type %s: %w" , mnt .Type , errdefs .ErrNotImplemented )
331329 }
332330
@@ -336,21 +334,16 @@ func mountsToLayerAndParents(mounts []mount.Mount) (string, []string, error) {
336334 }
337335
338336 if mnt .ReadOnly () {
339- if mnt .Type == "bind" && len (parentLayerPaths ) != 0 {
340- return "" , nil , fmt .Errorf ("unexpected bind-mount View with parents: %w" , errdefs .ErrInvalidArgument )
341- } else if mnt .Type == "bind" {
337+ if len (parentLayerPaths ) == 0 {
342338 // rootfs.CreateDiff creates a new, empty View to diff against,
343339 // when diffing something with no parent.
344340 // This makes perfect sense for a walking Diff, but for WCOW,
345341 // we have to recognise this as "diff against nothing"
346342 return "" , nil , nil
347- } else if len (parentLayerPaths ) == 0 {
348- return "" , nil , fmt .Errorf ("unexpected windows-layer View with no parent: %w" , errdefs .ErrInvalidArgument )
349343 }
350344 // Ignore the dummy sandbox.
351345 return parentLayerPaths [0 ], parentLayerPaths [1 :], nil
352346 }
353-
354347 return mnt .Source , parentLayerPaths , nil
355348}
356349
@@ -367,7 +360,7 @@ func mountPairToLayerStack(lower, upper []mount.Mount) ([]string, error) {
367360
368361 lowerLayer , lowerParentLayerPaths , err := mountsToLayerAndParents (lower )
369362 if errdefs .IsNotImplemented (err ) {
370- // Upper was a windows-layer or bind , lower is not. We can't handle that.
363+ // Upper was a windows-layer, lower is not. We can't handle that.
371364 return nil , fmt .Errorf ("windowsDiff cannot diff a windows-layer against a non-windows-layer: %w" , errdefs .ErrInvalidArgument )
372365 } else if err != nil {
373366 return nil , fmt .Errorf ("Lower mount invalid: %w" , err )
0 commit comments