Skip to content

Commit 9959582

Browse files
author
Ma Shimiao
committed
rename CheckRootfsPath to CheckRootfs
Signed-off-by: Ma Shimiao <[email protected]>
1 parent 6f8ff78 commit 9959582

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

validate/validate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func NewValidatorFromPath(bundlePath string, hostSpecific bool, platform string)
9696
// CheckAll checks all parts of runtime bundle
9797
func (v *Validator) CheckAll() (msgs []string) {
9898
msgs = append(msgs, v.CheckPlatform()...)
99-
msgs = append(msgs, v.CheckRootfsPath()...)
99+
msgs = append(msgs, v.CheckRootfs()...)
100100
msgs = append(msgs, v.CheckMandatoryFields()...)
101101
msgs = append(msgs, v.CheckSemVer()...)
102102
msgs = append(msgs, v.CheckMounts()...)
@@ -109,9 +109,9 @@ func (v *Validator) CheckAll() (msgs []string) {
109109
return
110110
}
111111

112-
// CheckRootfsPath checks status of v.spec.Root.Path
113-
func (v *Validator) CheckRootfsPath() (msgs []string) {
114-
logrus.Debugf("check rootfs path")
112+
// CheckRootfs checks status of v.spec.Root
113+
func (v *Validator) CheckRootfs() (msgs []string) {
114+
logrus.Debugf("check rootfs")
115115

116116
absBundlePath, err := filepath.Abs(v.bundlePath)
117117
if err != nil {

validate/validate_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ func checkErrors(t *testing.T, title string, msgs []string, valid bool) {
1818
}
1919
}
2020

21-
func TestCheckRootfsPath(t *testing.T) {
21+
func TestCheckRootfs(t *testing.T) {
2222
tmpBundle, err := ioutil.TempDir("", "oci-check-rootfspath")
2323
if err != nil {
24-
t.Fatalf("Failed to create a TempDir in 'CheckRootfsPath'")
24+
t.Fatalf("Failed to create a TempDir in 'CheckRootfs'")
2525
}
2626
defer os.RemoveAll(tmpBundle)
2727

2828
rootfsDir := "rootfs"
2929
rootfsNonDir := "rootfsfile"
3030
rootfsNonExists := "rootfsnil"
3131
if err := os.MkdirAll(filepath.Join(tmpBundle, rootfsDir), 0700); err != nil {
32-
t.Fatalf("Failed to create a rootfs directory in 'CheckRootfsPath'")
32+
t.Fatalf("Failed to create a rootfs directory in 'CheckRootfs'")
3333
}
3434
if _, err := os.Create(filepath.Join(tmpBundle, rootfsNonDir)); err != nil {
35-
t.Fatalf("Failed to create a non-directory rootfs in 'CheckRootfsPath'")
35+
t.Fatalf("Failed to create a non-directory rootfs in 'CheckRootfs'")
3636
}
3737

3838
cases := []struct {
@@ -48,7 +48,7 @@ func TestCheckRootfsPath(t *testing.T) {
4848
}
4949
for _, c := range cases {
5050
v := NewValidator(&rspec.Spec{Root: &rspec.Root{Path: c.val}}, tmpBundle, false, "linux")
51-
checkErrors(t, "CheckRootfsPath "+c.val, v.CheckRootfsPath(), c.expected)
51+
checkErrors(t, "CheckRootfs "+c.val, v.CheckRootfs(), c.expected)
5252
}
5353
}
5454

0 commit comments

Comments
 (0)