Skip to content

Commit acff3ee

Browse files
Improve error messages and remove check
* Improve error messages * remove a check for the existance of unmount target. We probably should not mask that the target was missing. Signed-off-by: Gabriel Adrian Samfira <[email protected]>
1 parent b4dd3bf commit acff3ee

4 files changed

Lines changed: 3 additions & 11 deletions

File tree

mount/mount_windows.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,6 @@ func (m *Mount) GetParentPaths() ([]string, error) {
132132

133133
// Unmount the mount at the provided path
134134
func Unmount(mount string, flags int) error {
135-
if _, err := os.Stat(mount); err != nil {
136-
if os.IsNotExist(err) {
137-
return nil
138-
}
139-
140-
return fmt.Errorf("failed to access mount point %s: %w", mount, err)
141-
}
142-
143135
mount = filepath.Clean(mount)
144136
adsFile := mount + ":" + sourceStreamName
145137
var layerPath string

snapshots/testsuite/issues.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func checkRemoveDirectoryInLowerLayer(ctx context.Context, t *testing.T, sn snap
9696
// see https://github.com/docker/docker/issues/28391 overlay2
9797
func checkChown(ctx context.Context, t *testing.T, sn snapshots.Snapshotter, work string) {
9898
if runtime.GOOS == "windows" {
99-
t.Skip("Chown is not supported on WCOW")
99+
t.Skip("Chown is not supported on Windows")
100100
}
101101
l1Init := fstest.Apply(
102102
fstest.CreateDir("/opt", 0700),

snapshots/testsuite/testsuite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ func closeTwice(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsho
877877

878878
func checkRootPermission(ctx context.Context, t *testing.T, snapshotter snapshots.Snapshotter, work string) {
879879
if runtime.GOOS == "windows" {
880-
t.Skip("Filesystem permissions are not supported on WCOW")
880+
t.Skip("Filesystem permissions are not supported on Windows")
881881
}
882882

883883
preparing, err := snapshotterPrepareMount(ctx, snapshotter, "preparing", "", work)

snapshots/windows/windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ func (s *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k
356356
// Create the new snapshot dir
357357
snDir := s.getSnapshotDir(newSnapshot.ID)
358358
if err = os.MkdirAll(snDir, 0700); err != nil {
359-
return fmt.Errorf("creating snapshot dir: %w", err)
359+
return fmt.Errorf("failed to create snapshot dir %s: %w", snDir, err)
360360
}
361361

362362
if strings.Contains(key, snapshots.UnpackKeyPrefix) {

0 commit comments

Comments
 (0)