mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
vendor: github.com/mistifyio/go-zfs/v3 v3.1.0
full diff: https://github.com/mistifyio/go-zfs/compare/v3.0.1...v3.1.0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
2
go.mod
2
go.mod
@@ -54,7 +54,7 @@ require (
|
||||
github.com/in-toto/in-toto-golang v0.9.0
|
||||
github.com/ishidawataru/sctp v0.0.0-20251114114122-19ddcbc6aae2
|
||||
github.com/miekg/dns v1.1.66
|
||||
github.com/mistifyio/go-zfs/v3 v3.0.1
|
||||
github.com/mistifyio/go-zfs/v3 v3.1.0
|
||||
github.com/mitchellh/copystructure v1.2.0
|
||||
github.com/moby/buildkit v0.26.2
|
||||
github.com/moby/docker-image-spec v1.3.1
|
||||
|
||||
4
go.sum
4
go.sum
@@ -405,8 +405,8 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N
|
||||
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
|
||||
github.com/miekg/dns v1.1.66 h1:FeZXOS3VCVsKnEAd+wBkjMC3D2K+ww66Cq3VnCINuJE=
|
||||
github.com/miekg/dns v1.1.66/go.mod h1:jGFzBsSNbJw6z1HYut1RKBKHA9PBdxeHrZG8J+gC2WE=
|
||||
github.com/mistifyio/go-zfs/v3 v3.0.1 h1:YaoXgBePoMA12+S1u/ddkv+QqxcfiZK4prI6HPnkFiU=
|
||||
github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k=
|
||||
github.com/mistifyio/go-zfs/v3 v3.1.0 h1:FZaylcg0hjUp27i23VcJJQiuBeAZjrC8lPqCGM1CopY=
|
||||
github.com/mistifyio/go-zfs/v3 v3.1.0/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
|
||||
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
|
||||
|
||||
42
vendor/github.com/mistifyio/go-zfs/v3/utils.go
generated
vendored
42
vendor/github.com/mistifyio/go-zfs/v3/utils.go
generated
vendored
@@ -2,6 +2,7 @@ package zfs
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -10,10 +11,37 @@ import (
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Runner specifies the parameters used when executing ZFS commands.
|
||||
type Runner struct {
|
||||
// Timeout specifies how long to wait before sending a SIGTERM signal to the running process.
|
||||
Timeout time.Duration
|
||||
|
||||
// Grace specifies the time waited after signaling the running process with SIGTERM before it is forcefully
|
||||
// killed with SIGKILL.
|
||||
Grace time.Duration
|
||||
}
|
||||
|
||||
var defaultRunner atomic.Value
|
||||
|
||||
func init() {
|
||||
defaultRunner.Store(&Runner{})
|
||||
}
|
||||
|
||||
func Default() *Runner {
|
||||
return defaultRunner.Load().(*Runner) //nolint: forcetypeassert // Impossible for it to be anything else.
|
||||
}
|
||||
|
||||
func SetRunner(runner *Runner) {
|
||||
defaultRunner.Store(runner)
|
||||
}
|
||||
|
||||
type command struct {
|
||||
Command string
|
||||
Stdin io.Reader
|
||||
@@ -21,7 +49,19 @@ type command struct {
|
||||
}
|
||||
|
||||
func (c *command) Run(arg ...string) ([][]string, error) {
|
||||
cmd := exec.Command(c.Command, arg...)
|
||||
var cmd *exec.Cmd
|
||||
if Default().Timeout == 0 {
|
||||
cmd = exec.Command(c.Command, arg...)
|
||||
} else {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Default().Timeout)
|
||||
defer cancel()
|
||||
|
||||
cmd = exec.CommandContext(ctx, c.Command, arg...)
|
||||
cmd.Cancel = func() error {
|
||||
return cmd.Process.Signal(syscall.SIGTERM)
|
||||
}
|
||||
cmd.WaitDelay = Default().Grace
|
||||
}
|
||||
|
||||
var stdout, stderr bytes.Buffer
|
||||
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -826,7 +826,7 @@ github.com/klauspost/compress/zstd/internal/xxhash
|
||||
# github.com/miekg/dns v1.1.66
|
||||
## explicit; go 1.23.0
|
||||
github.com/miekg/dns
|
||||
# github.com/mistifyio/go-zfs/v3 v3.0.1
|
||||
# github.com/mistifyio/go-zfs/v3 v3.1.0
|
||||
## explicit; go 1.14
|
||||
github.com/mistifyio/go-zfs/v3
|
||||
# github.com/mitchellh/copystructure v1.2.0
|
||||
|
||||
Reference in New Issue
Block a user