Merge pull request #6149 from ukontainer/vendor-moby-sys
vendor: update moby/sys for darwin support
This commit is contained in:
		
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							| @@ -38,7 +38,7 @@ require ( | |||||||
| 	github.com/imdario/mergo v0.3.12 | 	github.com/imdario/mergo v0.3.12 | ||||||
| 	github.com/klauspost/compress v1.11.13 | 	github.com/klauspost/compress v1.11.13 | ||||||
| 	github.com/moby/locker v1.0.1 | 	github.com/moby/locker v1.0.1 | ||||||
| 	github.com/moby/sys/mountinfo v0.4.1 | 	github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201 | ||||||
| 	github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 | 	github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 | ||||||
| 	github.com/moby/sys/symlink v0.1.0 | 	github.com/moby/sys/symlink v0.1.0 | ||||||
| 	github.com/opencontainers/go-digest v1.0.0 | 	github.com/opencontainers/go-digest v1.0.0 | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								go.sum
									
									
									
									
									
								
							| @@ -426,8 +426,9 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= | |||||||
| github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= | github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= | ||||||
| github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= | github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= | ||||||
| github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= | github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= | ||||||
| github.com/moby/sys/mountinfo v0.4.1 h1:1O+1cHA1aujwEwwVMa2Xm2l+gIpUHyd3+D+d7LZh1kM= |  | ||||||
| github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= | github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= | ||||||
|  | github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201 h1:3CCeKh7+WeRmAJdVR2aNruVqoRbHQ4UIq91gPnGdNrY= | ||||||
|  | github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= | ||||||
| github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 h1:PkXi3ZKVBSfi1skhCjUykUKRwKxn/D48Nj4D1sWalXk= | github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 h1:PkXi3ZKVBSfi1skhCjUykUKRwKxn/D48Nj4D1sWalXk= | ||||||
| github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879/go.mod h1:JwObcMnOrUy2VTP5swPKWwywH0Mbgk8Y5qua9iwtIRM= | github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879/go.mod h1:JwObcMnOrUy2VTP5swPKWwywH0Mbgk8Y5qua9iwtIRM= | ||||||
| github.com/moby/sys/symlink v0.1.0 h1:MTFZ74KtNI6qQQpuBxU+uKCim4WtOMokr03hCfJcazE= | github.com/moby/sys/symlink v0.1.0 h1:MTFZ74KtNI6qQQpuBxU+uKCim4WtOMokr03hCfJcazE= | ||||||
|   | |||||||
| @@ -402,8 +402,9 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh | |||||||
| github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= | github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= | ||||||
| github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= | github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= | ||||||
| github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= | github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= | ||||||
| github.com/moby/sys/mountinfo v0.4.1 h1:1O+1cHA1aujwEwwVMa2Xm2l+gIpUHyd3+D+d7LZh1kM= |  | ||||||
| github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= | github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= | ||||||
|  | github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201 h1:3CCeKh7+WeRmAJdVR2aNruVqoRbHQ4UIq91gPnGdNrY= | ||||||
|  | github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= | ||||||
| github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 h1:PkXi3ZKVBSfi1skhCjUykUKRwKxn/D48Nj4D1sWalXk= | github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 h1:PkXi3ZKVBSfi1skhCjUykUKRwKxn/D48Nj4D1sWalXk= | ||||||
| github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879/go.mod h1:JwObcMnOrUy2VTP5swPKWwywH0Mbgk8Y5qua9iwtIRM= | github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879/go.mod h1:JwObcMnOrUy2VTP5swPKWwywH0Mbgk8Y5qua9iwtIRM= | ||||||
| github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= | github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								vendor/github.com/moby/sys/mountinfo/mounted_unix.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/moby/sys/mountinfo/mounted_unix.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| // +build linux freebsd,cgo openbsd,cgo | // +build linux freebsd,cgo openbsd,cgo darwin,cgo | ||||||
|  |  | ||||||
| package mountinfo | package mountinfo | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| // +build freebsd,cgo openbsd,cgo | // +build freebsd,cgo openbsd,cgo darwin,cgo | ||||||
|  |  | ||||||
| package mountinfo | package mountinfo | ||||||
|  |  | ||||||
| @@ -21,7 +21,7 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) { | |||||||
|  |  | ||||||
| 	count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) | 	count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) | ||||||
| 	if count == 0 { | 	if count == 0 { | ||||||
| 		return nil, fmt.Errorf("Failed to call getmntinfo") | 		return nil, fmt.Errorf("failed to call getmntinfo") | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	var entries []C.struct_statfs | 	var entries []C.struct_statfs | ||||||
|   | |||||||
							
								
								
									
										27
									
								
								vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										27
									
								
								vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -52,7 +52,7 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) { | |||||||
| 		numFields := len(fields) | 		numFields := len(fields) | ||||||
| 		if numFields < 10 { | 		if numFields < 10 { | ||||||
| 			// should be at least 10 fields | 			// should be at least 10 fields | ||||||
| 			return nil, fmt.Errorf("Parsing '%s' failed: not enough fields (%d)", text, numFields) | 			return nil, fmt.Errorf("parsing '%s' failed: not enough fields (%d)", text, numFields) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		// separator field | 		// separator field | ||||||
| @@ -67,7 +67,7 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) { | |||||||
| 		for fields[sepIdx] != "-" { | 		for fields[sepIdx] != "-" { | ||||||
| 			sepIdx-- | 			sepIdx-- | ||||||
| 			if sepIdx == 5 { | 			if sepIdx == 5 { | ||||||
| 				return nil, fmt.Errorf("Parsing '%s' failed: missing - separator", text) | 				return nil, fmt.Errorf("parsing '%s' failed: missing - separator", text) | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| @@ -75,46 +75,39 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) { | |||||||
|  |  | ||||||
| 		p.Mountpoint, err = unescape(fields[4]) | 		p.Mountpoint, err = unescape(fields[4]) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, fmt.Errorf("Parsing '%s' failed: mount point: %w", fields[4], err) | 			return nil, fmt.Errorf("parsing '%s' failed: mount point: %w", fields[4], err) | ||||||
| 		} | 		} | ||||||
| 		p.FSType, err = unescape(fields[sepIdx+1]) | 		p.FSType, err = unescape(fields[sepIdx+1]) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, fmt.Errorf("Parsing '%s' failed: fstype: %w", fields[sepIdx+1], err) | 			return nil, fmt.Errorf("parsing '%s' failed: fstype: %w", fields[sepIdx+1], err) | ||||||
| 		} | 		} | ||||||
| 		p.Source, err = unescape(fields[sepIdx+2]) | 		p.Source, err = unescape(fields[sepIdx+2]) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, fmt.Errorf("Parsing '%s' failed: source: %w", fields[sepIdx+2], err) | 			return nil, fmt.Errorf("parsing '%s' failed: source: %w", fields[sepIdx+2], err) | ||||||
| 		} | 		} | ||||||
| 		p.VFSOptions = fields[sepIdx+3] | 		p.VFSOptions = fields[sepIdx+3] | ||||||
|  |  | ||||||
| 		// ignore any numbers parsing errors, as there should not be any | 		// ignore any numbers parsing errors, as there should not be any | ||||||
| 		p.ID, _ = strconv.Atoi(fields[0]) | 		p.ID, _ = strconv.Atoi(fields[0]) | ||||||
| 		p.Parent, _ = strconv.Atoi(fields[1]) | 		p.Parent, _ = strconv.Atoi(fields[1]) | ||||||
| 		mm := strings.Split(fields[2], ":") | 		mm := strings.SplitN(fields[2], ":", 3) | ||||||
| 		if len(mm) != 2 { | 		if len(mm) != 2 { | ||||||
| 			return nil, fmt.Errorf("Parsing '%s' failed: unexpected minor:major pair %s", text, mm) | 			return nil, fmt.Errorf("parsing '%s' failed: unexpected major:minor pair %s", text, mm) | ||||||
| 		} | 		} | ||||||
| 		p.Major, _ = strconv.Atoi(mm[0]) | 		p.Major, _ = strconv.Atoi(mm[0]) | ||||||
| 		p.Minor, _ = strconv.Atoi(mm[1]) | 		p.Minor, _ = strconv.Atoi(mm[1]) | ||||||
|  |  | ||||||
| 		p.Root, err = unescape(fields[3]) | 		p.Root, err = unescape(fields[3]) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, fmt.Errorf("Parsing '%s' failed: root: %w", fields[3], err) | 			return nil, fmt.Errorf("parsing '%s' failed: root: %w", fields[3], err) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		p.Options = fields[5] | 		p.Options = fields[5] | ||||||
|  |  | ||||||
| 		// zero or more optional fields | 		// zero or more optional fields | ||||||
| 		switch { | 		p.Optional = strings.Join(fields[6:sepIdx], " ") | ||||||
| 		case sepIdx == 6: |  | ||||||
| 			// zero, do nothing |  | ||||||
| 		case sepIdx == 7: |  | ||||||
| 			p.Optional = fields[6] |  | ||||||
| 		default: |  | ||||||
| 			p.Optional = strings.Join(fields[6:sepIdx-1], " ") |  | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 		// Run the filter after parsing all of the fields. | 		// Run the filter after parsing all fields. | ||||||
| 		var skip, stop bool | 		var skip, stop bool | ||||||
| 		if filter != nil { | 		if filter != nil { | ||||||
| 			skip, stop = filter(p) | 			skip, stop = filter(p) | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| // +build !windows,!linux,!freebsd,!openbsd freebsd,!cgo openbsd,!cgo | // +build !windows,!linux,!freebsd,!openbsd,!darwin freebsd,!cgo openbsd,!cgo darwin,!cgo | ||||||
|  |  | ||||||
| package mountinfo | package mountinfo | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							| @@ -289,7 +289,7 @@ github.com/moby/locker | |||||||
| # github.com/moby/spdystream v0.2.0 | # github.com/moby/spdystream v0.2.0 | ||||||
| github.com/moby/spdystream | github.com/moby/spdystream | ||||||
| github.com/moby/spdystream/spdy | github.com/moby/spdystream/spdy | ||||||
| # github.com/moby/sys/mountinfo v0.4.1 | # github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201 | ||||||
| ## explicit | ## explicit | ||||||
| github.com/moby/sys/mountinfo | github.com/moby/sys/mountinfo | ||||||
| # github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 | # github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Derek McGowan
					Derek McGowan