Skip to content

Commit

Permalink
refactor: move IsMountPointReadOnly from utils to kubernetes package
Browse files Browse the repository at this point in the history
Signed-off-by: Chin-Ya Huang <[email protected]>
  • Loading branch information
c3y1huang committed Apr 25, 2024
1 parent 7542866 commit 462ba85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion utils/mount.go → kubernetes/mount.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package kubernetes

import (
"k8s.io/mount-utils"
Expand Down
9 changes: 5 additions & 4 deletions utils/mount_test.go → kubernetes/mount_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package utils
package kubernetes

import (
. "gopkg.in/check.v1"

"github.com/longhorn/go-common-libs/test"

"k8s.io/mount-utils"
)

Expand All @@ -13,19 +14,19 @@ func (s *TestSuite) TestIsMountPointReadOnly(c *C) {
expected bool
}
testCases := map[string]testCase{
"readOnly": {
"IsMountPointReadOnly(...): readOnly": {
input: mount.MountPoint{
Opts: []string{"ro"},
},
expected: true,
},
"readWrite": {
"IsMountPointReadOnly(...): readWrite": {
input: mount.MountPoint{
Opts: []string{"rw"},
},
expected: false,
},
"empty": {
"IsMountPointReadOnly(...): empty": {
input: mount.MountPoint{
Opts: []string{},
},
Expand Down

0 comments on commit 462ba85

Please sign in to comment.