Skip to content

Commit

Permalink
Fix typo in 'mount directory does not exist' (#1633)
Browse files Browse the repository at this point in the history
  • Loading branch information
loadams authored Feb 17, 2025
1 parent b98358a commit 2dde93c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (opt *mountOptions) validate(skipNonEmptyMount bool) error {
}

if _, err := os.Stat(opt.MountPath); os.IsNotExist(err) {
return fmt.Errorf("mount directory does not exists")
return fmt.Errorf("mount directory does not exist")
} else if common.IsDirectoryMounted(opt.MountPath) {
// Try to cleanup the stale mount
log.Info("Mount::validate : Mount directory is already mounted, trying to cleanup")
Expand Down Expand Up @@ -271,7 +271,7 @@ var mountCmd = &cobra.Command{
if options.ConfigFile == "" {
// Config file is not set in cli parameters
// Blobfuse2 defaults to config.yaml in current directory
// If the file does not exists then user might have configured required things in env variables
// If the file does not exist then user might have configured required things in env variables
// Fall back to defaults and let components fail if all required env variables are not set.
_, err := os.Stat(common.DefaultConfigFilePath)
if err != nil && os.IsNotExist(err) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ func (suite *mountTestSuite) cleanupTest() {
common.DefaultLogFilePath = filepath.Join(common.DefaultWorkDir, "blobfuse2.log")
}

// mount failure test where the mount directory does not exists
// mount failure test where the mount directory does not exist
func (suite *mountTestSuite) TestMountDirNotExists() {
defer suite.cleanupTest()

tempDir := randomString(8)
op, err := executeCommandC(rootCmd, "mount", tempDir, fmt.Sprintf("--config-file=%s", confFileMntTest))
suite.assert.NotNil(err)
suite.assert.Contains(op, "mount directory does not exists")
suite.assert.Contains(op, "mount directory does not exist")

op, err = executeCommandC(rootCmd, "mount", "all", tempDir, fmt.Sprintf("--config-file=%s", confFileMntTest))
suite.assert.NotNil(err)
suite.assert.Contains(op, "mount directory does not exists")
suite.assert.Contains(op, "mount directory does not exist")
}

// mount failure test where the mount directory is not empty
Expand Down
2 changes: 1 addition & 1 deletion cmd/unmount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (suite *unmountTestSuite) cleanupTest() {
time.Sleep(2 * time.Second)
}

// mount failure test where the mount directory does not exists
// mount failure test where the mount directory does not exist
func (suite *unmountTestSuite) TestUnmountCmd() {
defer suite.cleanupTest()

Expand Down
2 changes: 1 addition & 1 deletion internal/handlemap/handle_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (suite *HandleMapSuite) SetupTest() {
suite.assert = assert.New(suite.T())
}

// mount failure test where the mount directory does not exists
// mount failure test where the mount directory does not exist
func (suite *HandleMapSuite) TestNewHandle() {
h := NewHandle("abc")
suite.assert.NotNil(h)
Expand Down
4 changes: 2 additions & 2 deletions test/mount_test/mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (suite *mountSuite) TestMountCmd() {
blobfuseUnmount(suite, mntDir)
}

// mount failure test where the mount directory does not exists
// mount failure test where the mount directory does not exist
func (suite *mountSuite) TestMountDirNotExists() {
tempDir := filepath.Join(mntDir, "tempdir")
mountCmd := exec.Command(blobfuseBinary, "mount", tempDir, "--config-file="+configFile)
Expand All @@ -129,7 +129,7 @@ func (suite *mountSuite) TestMountDirNotExists() {
suite.NotEqual(nil, err)
fmt.Println(errb.String())
suite.NotEqual(0, len(errb.String()))
suite.Contains(errb.String(), "mount directory does not exists")
suite.Contains(errb.String(), "mount directory does not exist")

// list blobfuse mounted directories
cliOut := listBlobfuseMounts(suite)
Expand Down

0 comments on commit 2dde93c

Please sign in to comment.