瀏覽代碼

Merge pull request #13591 from kvasdopil/update-go-zfs

Update go-zfs to last version
Alexander Morozov 10 年之前
父節點
當前提交
3f26066425

+ 1 - 1
hack/vendor.sh

@@ -49,7 +49,7 @@ clone git github.com/go-check/check 64131543e7896d5bcc6bd5a76287eb75ea96c673
 clone git github.com/gorilla/context 14f550f51a
 clone git github.com/gorilla/mux e444e69cbd
 clone git github.com/kr/pty 5cf931ef8f
-clone git github.com/mistifyio/go-zfs v2.1.0
+clone git github.com/mistifyio/go-zfs v2.1.1
 clone git github.com/tchap/go-patricia v2.1.0
 clone hg code.google.com/p/go.net 84a4013f96e0
 clone hg code.google.com/p/gosqlite 74691fb6f837

+ 9 - 0
vendor/src/github.com/mistifyio/go-zfs/CONTRIBUTING.md

@@ -47,5 +47,14 @@ Push your feature branch to your fork.
 
 **Important:** By submitting a patch, you agree to allow the project owners to license your work under the [Apache 2.0 License](./LICENSE).
 
+### Go Tools ###
+For consistency and to catch minor issues for all of go code, please run the following:
+* goimports
+* go vet
+* golint
+* errcheck
+
+Many editors can execute the above on save.
+
 ----
 Guidelines based on http://azkaban.github.io/contributing.html

+ 1 - 1
vendor/src/github.com/mistifyio/go-zfs/utils.go

@@ -264,7 +264,7 @@ func parseInodeChanges(lines [][]string) ([]*InodeChange, error) {
 }
 
 func listByType(t, filter string) ([]*Dataset, error) {
-	args := []string{"get", "all", "-t", t, "-rHp"}
+	args := []string{"get", "-rHp", "-t", t, "all"}
 	if filter != "" {
 		args = append(args, filter)
 	}

+ 2 - 2
vendor/src/github.com/mistifyio/go-zfs/zfs.go

@@ -137,7 +137,7 @@ func Volumes(filter string) ([]*Dataset, error) {
 // GetDataset retrieves a single ZFS dataset by name.  This dataset could be
 // any valid ZFS dataset type, such as a clone, filesystem, snapshot, or volume.
 func GetDataset(name string) (*Dataset, error) {
-	out, err := zfs("get", "all", "-Hp", name)
+	out, err := zfs("get", "-Hp", "all", name)
 	if err != nil {
 		return nil, err
 	}
@@ -335,7 +335,7 @@ func (d *Dataset) Rollback(destroyMoreRecent bool) error {
 // A recursion depth may be specified, or a depth of 0 allows unlimited
 // recursion.
 func (d *Dataset) Children(depth uint64) ([]*Dataset, error) {
-	args := []string{"get", "all", "-t", "all", "-Hp"}
+	args := []string{"get", "-t", "all", "-Hp", "all"}
 	if depth > 0 {
 		args = append(args, "-d")
 		args = append(args, strconv.FormatUint(depth, 10))

+ 4 - 2
vendor/src/github.com/mistifyio/go-zfs/zfs_test.go

@@ -262,8 +262,10 @@ func TestChildren(t *testing.T) {
 
 func TestListZpool(t *testing.T) {
 	zpoolTest(t, func() {
-		_, err := zfs.ListZpools()
+		pools, err := zfs.ListZpools()
 		ok(t, err)
+		equals(t, "test", pools[0].Name)
+
 	})
 }
 
@@ -292,7 +294,7 @@ func TestRollback(t *testing.T) {
 		ok(t, err)
 
 		err = s1.Rollback(false)
-		assert(t, ok != nil, "should error when rolling back beyond most recent without destroyMoreRecent = true")
+		assert(t, err != nil, "should error when rolling back beyond most recent without destroyMoreRecent = true")
 
 		err = s1.Rollback(true)
 		ok(t, err)

+ 0 - 3
vendor/src/github.com/mistifyio/go-zfs/zpool.go

@@ -92,9 +92,6 @@ func ListZpools() ([]*Zpool, error) {
 		return nil, err
 	}
 
-	// there is no -H
-	out = out[1:]
-
 	var pools []*Zpool
 
 	for _, line := range out {