diff --git a/go.mod b/go.mod index f76aed71f..8582292e5 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/operator-framework/api v0.36.0 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.83.0 github.com/prometheus/client_golang v1.23.2 - github.com/regclient/regclient v0.9.2 + github.com/regclient/regclient v0.10.0 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.11.1 github.com/urfave/cli/v3 v3.5.0 @@ -70,7 +70,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.0 // indirect + github.com/klauspost/compress v1.18.1 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.9.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -94,7 +94,7 @@ require ( github.com/shopspring/decimal v1.4.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.10.1 // indirect - github.com/spf13/pflag v1.0.9 // indirect + github.com/spf13/pflag v1.0.10 // indirect github.com/ulikunitz/xz v0.5.15 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xlab/treeprint v1.2.0 // indirect @@ -105,7 +105,7 @@ require ( golang.org/x/net v0.46.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect golang.org/x/sync v0.17.0 // indirect - golang.org/x/sys v0.37.0 // indirect + golang.org/x/sys v0.38.0 // indirect golang.org/x/term v0.36.0 // indirect golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.12.0 // indirect diff --git a/go.sum b/go.sum index e91cbc726..2cab38298 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co= +github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -179,8 +179,8 @@ github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9Z github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= -github.com/regclient/regclient v0.9.2 h1:5mJYY3NSV7xtBCv+Me3mbfcNJg9u7nrNt/Z6Od7QjVM= -github.com/regclient/regclient v0.9.2/go.mod h1:QOi29pa84xH+AA56bQwQbzw3RZDwqHrG15KTXGeO+Q8= +github.com/regclient/regclient v0.10.0 h1:V+mbcd/PBwQkd89M2KAPAAC1qMyrw9f5BKvCtPgw/C8= +github.com/regclient/regclient v0.10.0/go.mod h1:fDYvRK2yFUE7pyEXKj+jKzTAtuwXsGQ6Tr0KPvxwP00= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -195,8 +195,9 @@ github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= -github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= @@ -262,8 +263,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= -golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q= golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/vendor/github.com/klauspost/compress/fse/bitwriter.go b/vendor/github.com/klauspost/compress/fse/bitwriter.go index e82fa3bb7..d58b3fe42 100644 --- a/vendor/github.com/klauspost/compress/fse/bitwriter.go +++ b/vendor/github.com/klauspost/compress/fse/bitwriter.go @@ -143,7 +143,7 @@ func (b *bitWriter) flush32() { // flushAlign will flush remaining full bytes and align to next byte boundary. func (b *bitWriter) flushAlign() { nbBytes := (b.nBits + 7) >> 3 - for i := uint8(0); i < nbBytes; i++ { + for i := range nbBytes { b.out = append(b.out, byte(b.bitContainer>>(i*8))) } b.nBits = 0 diff --git a/vendor/github.com/klauspost/compress/fse/compress.go b/vendor/github.com/klauspost/compress/fse/compress.go index 074018d8f..8c8baa4fc 100644 --- a/vendor/github.com/klauspost/compress/fse/compress.go +++ b/vendor/github.com/klauspost/compress/fse/compress.go @@ -396,7 +396,7 @@ func (s *Scratch) buildCTable() error { if v > largeLimit { s.zeroBits = true } - for nbOccurrences := int16(0); nbOccurrences < v; nbOccurrences++ { + for range v { tableSymbol[position] = symbol position = (position + step) & tableMask for position > highThreshold { diff --git a/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/vendor/github.com/klauspost/compress/huff0/bitwriter.go index 0ebc9aaac..41db94cde 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitwriter.go +++ b/vendor/github.com/klauspost/compress/huff0/bitwriter.go @@ -85,7 +85,7 @@ func (b *bitWriter) flush32() { // flushAlign will flush remaining full bytes and align to next byte boundary. func (b *bitWriter) flushAlign() { nbBytes := (b.nBits + 7) >> 3 - for i := uint8(0); i < nbBytes; i++ { + for i := range nbBytes { b.out = append(b.out, byte(b.bitContainer>>(i*8))) } b.nBits = 0 diff --git a/vendor/github.com/klauspost/compress/huff0/compress.go b/vendor/github.com/klauspost/compress/huff0/compress.go index 84aa3d12f..a97cf1b5d 100644 --- a/vendor/github.com/klauspost/compress/huff0/compress.go +++ b/vendor/github.com/klauspost/compress/huff0/compress.go @@ -276,7 +276,7 @@ func (s *Scratch) compress4X(src []byte) ([]byte, error) { offsetIdx := len(s.Out) s.Out = append(s.Out, sixZeros[:]...) - for i := 0; i < 4; i++ { + for i := range 4 { toDo := src if len(toDo) > segmentSize { toDo = toDo[:segmentSize] @@ -312,7 +312,7 @@ func (s *Scratch) compress4Xp(src []byte) ([]byte, error) { segmentSize := (len(src) + 3) / 4 var wg sync.WaitGroup wg.Add(4) - for i := 0; i < 4; i++ { + for i := range 4 { toDo := src if len(toDo) > segmentSize { toDo = toDo[:segmentSize] @@ -326,7 +326,7 @@ func (s *Scratch) compress4Xp(src []byte) ([]byte, error) { }(i) } wg.Wait() - for i := 0; i < 4; i++ { + for i := range 4 { o := s.tmpOut[i] if len(o) > math.MaxUint16 { // We cannot store the size in the jump table diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go index 0f56b02d7..7d0efa881 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -626,7 +626,7 @@ func (d *Decoder) decompress4X8bit(dst, src []byte) ([]byte, error) { var br [4]bitReaderBytes start := 6 - for i := 0; i < 3; i++ { + for i := range 3 { length := int(src[i*2]) | (int(src[i*2+1]) << 8) if start+length >= len(src) { return nil, errors.New("truncated input (or invalid offset)") @@ -798,10 +798,7 @@ func (d *Decoder) decompress4X8bit(dst, src []byte) ([]byte, error) { remainBytes := dstEvery - (decoded / 4) for i := range br { offset := dstEvery * i - endsAt := offset + remainBytes - if endsAt > len(out) { - endsAt = len(out) - } + endsAt := min(offset+remainBytes, len(out)) br := &br[i] bitsLeft := br.remaining() for bitsLeft > 0 { @@ -864,7 +861,7 @@ func (d *Decoder) decompress4X8bit(dst, src []byte) ([]byte, error) { func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) { var br [4]bitReaderBytes start := 6 - for i := 0; i < 3; i++ { + for i := range 3 { length := int(src[i*2]) | (int(src[i*2+1]) << 8) if start+length >= len(src) { return nil, errors.New("truncated input (or invalid offset)") @@ -1035,10 +1032,7 @@ func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) { remainBytes := dstEvery - (decoded / 4) for i := range br { offset := dstEvery * i - endsAt := offset + remainBytes - if endsAt > len(out) { - endsAt = len(out) - } + endsAt := min(offset+remainBytes, len(out)) br := &br[i] bitsLeft := br.remaining() for bitsLeft > 0 { diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go index ba7e8e6b0..99ddd4af9 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go @@ -58,7 +58,7 @@ func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { var br [4]bitReaderShifted // Decode "jump table" start := 6 - for i := 0; i < 3; i++ { + for i := range 3 { length := int(src[i*2]) | (int(src[i*2+1]) << 8) if start+length >= len(src) { return nil, errors.New("truncated input (or invalid offset)") @@ -109,10 +109,7 @@ func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { remainBytes := dstEvery - (decoded / 4) for i := range br { offset := dstEvery * i - endsAt := offset + remainBytes - if endsAt > len(out) { - endsAt = len(out) - } + endsAt := min(offset+remainBytes, len(out)) br := &br[i] bitsLeft := br.remaining() for bitsLeft > 0 { diff --git a/vendor/github.com/klauspost/compress/huff0/huff0.go b/vendor/github.com/klauspost/compress/huff0/huff0.go index 77ecd68e0..67d9e05b6 100644 --- a/vendor/github.com/klauspost/compress/huff0/huff0.go +++ b/vendor/github.com/klauspost/compress/huff0/huff0.go @@ -201,7 +201,7 @@ func (c cTable) write(s *Scratch) error { for i := range hist[:16] { hist[i] = 0 } - for n := uint8(0); n < maxSymbolValue; n++ { + for n := range maxSymbolValue { v := bitsToWeight[c[n].nBits] & 15 huffWeight[n] = v hist[v]++ @@ -271,7 +271,7 @@ func (c cTable) estTableSize(s *Scratch) (sz int, err error) { for i := range hist[:16] { hist[i] = 0 } - for n := uint8(0); n < maxSymbolValue; n++ { + for n := range maxSymbolValue { v := bitsToWeight[c[n].nBits] & 15 huffWeight[n] = v hist[v]++ diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go index 0cfb5c0e2..4f2a0d8c5 100644 --- a/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go +++ b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go @@ -37,6 +37,6 @@ func Store32(b []byte, v uint32) { } // Store64 will store v at b. -func Store64(b []byte, v uint64) { - binary.LittleEndian.PutUint64(b, v) +func Store64[I Indexer](b []byte, i I, v uint64) { + binary.LittleEndian.PutUint64(b[i:], v) } diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go index ada45cd90..218a38bc4 100644 --- a/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go +++ b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go @@ -38,18 +38,15 @@ func Load64[I Indexer](b []byte, i I) uint64 { // Store16 will store v at b. func Store16(b []byte, v uint16) { - //binary.LittleEndian.PutUint16(b, v) *(*uint16)(unsafe.Pointer(unsafe.SliceData(b))) = v } // Store32 will store v at b. func Store32(b []byte, v uint32) { - //binary.LittleEndian.PutUint32(b, v) *(*uint32)(unsafe.Pointer(unsafe.SliceData(b))) = v } -// Store64 will store v at b. -func Store64(b []byte, v uint64) { - //binary.LittleEndian.PutUint64(b, v) - *(*uint64)(unsafe.Pointer(unsafe.SliceData(b))) = v +// Store64 will store v at b[i:]. +func Store64[I Indexer](b []byte, i I, v uint64) { + *(*uint64)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) = v } diff --git a/vendor/github.com/klauspost/compress/internal/snapref/decode.go b/vendor/github.com/klauspost/compress/internal/snapref/decode.go index 40796a49d..a2c82fcd2 100644 --- a/vendor/github.com/klauspost/compress/internal/snapref/decode.go +++ b/vendor/github.com/klauspost/compress/internal/snapref/decode.go @@ -209,7 +209,7 @@ func (r *Reader) fill() error { if !r.readFull(r.buf[:len(magicBody)], false) { return r.err } - for i := 0; i < len(magicBody); i++ { + for i := range len(magicBody) { if r.buf[i] != magicBody[i] { r.err = ErrCorrupt return r.err diff --git a/vendor/github.com/klauspost/compress/internal/snapref/encode.go b/vendor/github.com/klauspost/compress/internal/snapref/encode.go index 13c6040a5..860a99416 100644 --- a/vendor/github.com/klauspost/compress/internal/snapref/encode.go +++ b/vendor/github.com/klauspost/compress/internal/snapref/encode.go @@ -20,8 +20,10 @@ import ( func Encode(dst, src []byte) []byte { if n := MaxEncodedLen(len(src)); n < 0 { panic(ErrTooLarge) - } else if len(dst) < n { + } else if cap(dst) < n { dst = make([]byte, n) + } else { + dst = dst[:n] } // The block starts with the varint-encoded length of the decompressed bytes. diff --git a/vendor/github.com/klauspost/compress/zstd/bitwriter.go b/vendor/github.com/klauspost/compress/zstd/bitwriter.go index 1952f175b..b22b297e6 100644 --- a/vendor/github.com/klauspost/compress/zstd/bitwriter.go +++ b/vendor/github.com/klauspost/compress/zstd/bitwriter.go @@ -88,7 +88,7 @@ func (b *bitWriter) flush32() { // flushAlign will flush remaining full bytes and align to next byte boundary. func (b *bitWriter) flushAlign() { nbBytes := (b.nBits + 7) >> 3 - for i := uint8(0); i < nbBytes; i++ { + for i := range nbBytes { b.out = append(b.out, byte(b.bitContainer>>(i*8))) } b.nBits = 0 diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index 0dd742fd2..2329e996f 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -54,11 +54,11 @@ const ( ) var ( - huffDecoderPool = sync.Pool{New: func() interface{} { + huffDecoderPool = sync.Pool{New: func() any { return &huff0.Scratch{} }} - fseDecoderPool = sync.Pool{New: func() interface{} { + fseDecoderPool = sync.Pool{New: func() any { return &fseDecoder{} }} ) @@ -553,7 +553,7 @@ func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) { if compMode&3 != 0 { return errors.New("corrupt block: reserved bits not zero") } - for i := uint(0); i < 3; i++ { + for i := range uint(3) { mode := seqCompMode((compMode >> (6 - i*2)) & 3) if debugDecoder { println("Table", tableIndex(i), "is", mode) diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index ea2a19376..30df5513d 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -373,11 +373,9 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { if cap(dst) == 0 && !d.o.limitToCap { // Allocate len(input) * 2 by default if nothing is provided // and we didn't get frame content size. - size := len(input) * 2 - // Cap to 1 MB. - if size > 1<<20 { - size = 1 << 20 - } + size := min( + // Cap to 1 MB. + len(input)*2, 1<<20) if uint64(size) > d.o.maxDecodedSize { size = int(d.o.maxDecodedSize) } diff --git a/vendor/github.com/klauspost/compress/zstd/dict.go b/vendor/github.com/klauspost/compress/zstd/dict.go index b7b83164b..2ffbfdf37 100644 --- a/vendor/github.com/klauspost/compress/zstd/dict.go +++ b/vendor/github.com/klauspost/compress/zstd/dict.go @@ -194,17 +194,17 @@ func BuildDict(o BuildDictOptions) ([]byte, error) { hist := o.History contents := o.Contents debug := o.DebugOut != nil - println := func(args ...interface{}) { + println := func(args ...any) { if o.DebugOut != nil { fmt.Fprintln(o.DebugOut, args...) } } - printf := func(s string, args ...interface{}) { + printf := func(s string, args ...any) { if o.DebugOut != nil { fmt.Fprintf(o.DebugOut, s, args...) } } - print := func(args ...interface{}) { + print := func(args ...any) { if o.DebugOut != nil { fmt.Fprint(o.DebugOut, args...) } @@ -424,16 +424,10 @@ func BuildDict(o BuildDictOptions) ([]byte, error) { } // Literal table - avgSize := litTotal - if avgSize > huff0.BlockSizeMax/2 { - avgSize = huff0.BlockSizeMax / 2 - } + avgSize := min(litTotal, huff0.BlockSizeMax/2) huffBuff := make([]byte, 0, avgSize) // Target size - div := litTotal / avgSize - if div < 1 { - div = 1 - } + div := max(litTotal/avgSize, 1) if debug { println("Huffman weights:") } @@ -454,7 +448,7 @@ func BuildDict(o BuildDictOptions) ([]byte, error) { huffBuff = append(huffBuff, 255) } scratch := &huff0.Scratch{TableLog: 11} - for tries := 0; tries < 255; tries++ { + for tries := range 255 { scratch = &huff0.Scratch{TableLog: 11} _, _, err = huff0.Compress1X(huffBuff, scratch) if err == nil { @@ -471,7 +465,7 @@ func BuildDict(o BuildDictOptions) ([]byte, error) { // Bail out.... Just generate something huffBuff = append(huffBuff, bytes.Repeat([]byte{255}, 10000)...) - for i := 0; i < 128; i++ { + for i := range 128 { huffBuff = append(huffBuff, byte(i)) } continue diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go index 7d250c67f..c1192ec38 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_base.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -8,7 +8,7 @@ import ( ) const ( - dictShardBits = 6 + dictShardBits = 7 ) type fastBase struct { @@ -41,11 +41,9 @@ func (e *fastBase) AppendCRC(dst []byte) []byte { // or a window size small enough to contain the input size, if > 0. func (e *fastBase) WindowSize(size int64) int32 { if size > 0 && size < int64(e.maxMatchOff) { - b := int32(1) << uint(bits.Len(uint(size))) - // Keep minimum window. - if b < 1024 { - b = 1024 - } + b := max( + // Keep minimum window. + int32(1)< tMin && s > nextEmit && src[offset-1] == src[s-1] && l < maxMatchLength { s-- offset-- @@ -382,10 +377,7 @@ encodeLoop: nextEmit = s // Index skipped... - end := s - if s > sLimit+4 { - end = sLimit + 4 - } + end := min(s, sLimit+4) off := index0 + e.cur for index0 < end { cv0 := load6432(src, index0) @@ -444,10 +436,7 @@ encodeLoop: nextEmit = s // Index old s + 1 -> s - 1 or sLimit - end := s - if s > sLimit-4 { - end = sLimit - 4 - } + end := min(s, sLimit-4) off := index0 + e.cur for index0 < end { diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go index 84a79fde7..85dcd28c3 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_better.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_better.go @@ -190,10 +190,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { repIndex-- start-- @@ -252,10 +249,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { repIndex-- start-- @@ -480,10 +474,7 @@ encodeLoop: l := matched // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { s-- t-- @@ -719,10 +710,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { repIndex-- start-- @@ -783,10 +771,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { repIndex-- start-- @@ -1005,10 +990,7 @@ encodeLoop: l := matched // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { s-- t-- diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go index d36be7bd8..cf8cad00d 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -13,7 +13,7 @@ const ( dFastLongLen = 8 // Bytes used for table hash dLongTableShardCnt = 1 << (dFastLongTableBits - dictShardBits) // Number of shards in the table - dLongTableShardSize = dFastLongTableSize / tableShardCnt // Size of an individual shard + dLongTableShardSize = dFastLongTableSize / dLongTableShardCnt // Size of an individual shard dFastShortTableBits = tableBits // Bits used in the short match table dFastShortTableSize = 1 << dFastShortTableBits // Size of the table @@ -149,10 +149,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { repIndex-- start-- @@ -266,10 +263,7 @@ encodeLoop: l := e.matchlen(s+4, t+4, src) + 4 // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { s-- t-- @@ -462,10 +456,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] { repIndex-- start-- @@ -576,10 +567,7 @@ encodeLoop: l := int32(matchLen(src[s+4:], src[t+4:])) + 4 // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for t > tMin && s > nextEmit && src[t-1] == src[s-1] { s-- t-- @@ -809,10 +797,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { repIndex-- start-- @@ -927,10 +912,7 @@ encodeLoop: l := e.matchlen(s+4, t+4, src) + 4 // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { s-- t-- diff --git a/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/vendor/github.com/klauspost/compress/zstd/enc_fast.go index f45a3da7d..9180a3a58 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_fast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -143,10 +143,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - sMin := s - e.maxMatchOff - if sMin < 0 { - sMin = 0 - } + sMin := max(s-e.maxMatchOff, 0) for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch { repIndex-- start-- @@ -223,10 +220,7 @@ encodeLoop: l := e.matchlen(s+4, t+4, src) + 4 // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { s-- t-- @@ -387,10 +381,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - sMin := s - e.maxMatchOff - if sMin < 0 { - sMin = 0 - } + sMin := max(s-e.maxMatchOff, 0) for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] { repIndex-- start-- @@ -469,10 +460,7 @@ encodeLoop: l := e.matchlen(s+4, t+4, src) + 4 // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for t > tMin && s > nextEmit && src[t-1] == src[s-1] { s-- t-- @@ -655,10 +643,7 @@ encodeLoop: // and have to do special offset treatment. startLimit := nextEmit + 1 - sMin := s - e.maxMatchOff - if sMin < 0 { - sMin = 0 - } + sMin := max(s-e.maxMatchOff, 0) for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch { repIndex-- start-- @@ -735,10 +720,7 @@ encodeLoop: l := e.matchlen(s+4, t+4, src) + 4 // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } + tMin := max(s-e.maxMatchOff, 0) for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { s-- t-- diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go index e47af66e7..d88f067e5 100644 --- a/vendor/github.com/klauspost/compress/zstd/framedec.go +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -238,10 +238,7 @@ func (d *frameDec) reset(br byteBuffer) error { if d.WindowSize == 0 && d.SingleSegment { // We may not need window in this case. - d.WindowSize = d.FrameContentSize - if d.WindowSize < MinWindowSize { - d.WindowSize = MinWindowSize - } + d.WindowSize = max(d.FrameContentSize, MinWindowSize) if d.WindowSize > d.o.maxDecodedSize { if debugDecoder { printf("window size %d > max %d\n", d.WindowSize, d.o.maxWindowSize) diff --git a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go index ab26326a8..3a0f4e7fb 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go @@ -149,7 +149,7 @@ func (s *fseEncoder) buildCTable() error { if v > largeLimit { s.zeroBits = true } - for nbOccurrences := int16(0); nbOccurrences < v; nbOccurrences++ { + for range v { tableSymbol[position] = symbol position = (position + step) & tableMask for position > highThreshold { diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go index 9a7de82f9..0bfb0e43c 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -231,10 +231,7 @@ func (s *sequenceDecs) decodeSync(hist []byte) error { llTable, mlTable, ofTable := s.litLengths.fse.dt[:maxTablesize], s.matchLengths.fse.dt[:maxTablesize], s.offsets.fse.dt[:maxTablesize] llState, mlState, ofState := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state out := s.out - maxBlockSize := maxCompressedBlockSize - if s.windowSize < maxBlockSize { - maxBlockSize = s.windowSize - } + maxBlockSize := min(s.windowSize, maxCompressedBlockSize) if debugDecoder { println("decodeSync: decoding", seqs, "sequences", br.remain(), "bits remain on stream") diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go index c59f17e07..1f8c3cec2 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go @@ -79,10 +79,7 @@ func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) { br := s.br - maxBlockSize := maxCompressedBlockSize - if s.windowSize < maxBlockSize { - maxBlockSize = s.windowSize - } + maxBlockSize := min(s.windowSize, maxCompressedBlockSize) ctx := decodeSyncAsmContext{ llTable: s.litLengths.fse.dt[:maxTablesize], @@ -237,10 +234,7 @@ func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmC func (s *sequenceDecs) decode(seqs []seqVals) error { br := s.br - maxBlockSize := maxCompressedBlockSize - if s.windowSize < maxBlockSize { - maxBlockSize = s.windowSize - } + maxBlockSize := min(s.windowSize, maxCompressedBlockSize) ctx := decodeAsmContext{ llTable: s.litLengths.fse.dt[:maxTablesize], diff --git a/vendor/github.com/klauspost/compress/zstd/simple_go124.go b/vendor/github.com/klauspost/compress/zstd/simple_go124.go new file mode 100644 index 000000000..2efc0497b --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/simple_go124.go @@ -0,0 +1,56 @@ +// Copyright 2025+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +//go:build go1.24 + +package zstd + +import ( + "errors" + "runtime" + "sync" + "weak" +) + +var weakMu sync.Mutex +var simpleEnc weak.Pointer[Encoder] +var simpleDec weak.Pointer[Decoder] + +// EncodeTo appends the encoded data from src to dst. +func EncodeTo(dst []byte, src []byte) []byte { + weakMu.Lock() + enc := simpleEnc.Value() + if enc == nil { + var err error + enc, err = NewWriter(nil, WithEncoderConcurrency(runtime.NumCPU()), WithWindowSize(1<<20), WithLowerEncoderMem(true), WithZeroFrames(true)) + if err != nil { + panic("failed to create simple encoder: " + err.Error()) + } + simpleEnc = weak.Make(enc) + } + weakMu.Unlock() + + return enc.EncodeAll(src, dst) +} + +// DecodeTo appends the decoded data from src to dst. +// The maximum decoded size is 1GiB, +// not including what may already be in dst. +func DecodeTo(dst []byte, src []byte) ([]byte, error) { + weakMu.Lock() + dec := simpleDec.Value() + if dec == nil { + var err error + dec, err = NewReader(nil, WithDecoderConcurrency(runtime.NumCPU()), WithDecoderLowmem(true), WithDecoderMaxMemory(1<<30)) + if err != nil { + weakMu.Unlock() + return nil, errors.New("failed to create simple decoder: " + err.Error()) + } + runtime.SetFinalizer(dec, func(d *Decoder) { + d.Close() + }) + simpleDec = weak.Make(dec) + } + weakMu.Unlock() + return dec.DecodeAll(src, dst) +} diff --git a/vendor/github.com/klauspost/compress/zstd/snappy.go b/vendor/github.com/klauspost/compress/zstd/snappy.go index a17381b8f..336c28893 100644 --- a/vendor/github.com/klauspost/compress/zstd/snappy.go +++ b/vendor/github.com/klauspost/compress/zstd/snappy.go @@ -257,7 +257,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { if !r.readFull(r.buf[:len(snappyMagicBody)], false) { return written, r.err } - for i := 0; i < len(snappyMagicBody); i++ { + for i := range len(snappyMagicBody) { if r.buf[i] != snappyMagicBody[i] { println("r.buf[i] != snappyMagicBody[i]", r.buf[i], snappyMagicBody[i], i) r.err = ErrSnappyCorrupt diff --git a/vendor/github.com/klauspost/compress/zstd/zip.go b/vendor/github.com/klauspost/compress/zstd/zip.go index 29c15c8c4..3198d7189 100644 --- a/vendor/github.com/klauspost/compress/zstd/zip.go +++ b/vendor/github.com/klauspost/compress/zstd/zip.go @@ -19,7 +19,7 @@ const ZipMethodWinZip = 93 const ZipMethodPKWare = 20 // zipReaderPool is the default reader pool. -var zipReaderPool = sync.Pool{New: func() interface{} { +var zipReaderPool = sync.Pool{New: func() any { z, err := NewReader(nil, WithDecoderLowmem(true), WithDecoderMaxWindow(128<<20), WithDecoderConcurrency(1)) if err != nil { panic(err) diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go index 6252b46ae..1a869710d 100644 --- a/vendor/github.com/klauspost/compress/zstd/zstd.go +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -98,13 +98,13 @@ var ( ErrDecoderNilInput = errors.New("nil input provided as reader") ) -func println(a ...interface{}) { +func println(a ...any) { if debug || debugDecoder || debugEncoder { log.Println(a...) } } -func printf(format string, a ...interface{}) { +func printf(format string, a ...any) { if debug || debugDecoder || debugEncoder { log.Printf(format, a...) } diff --git a/vendor/github.com/regclient/regclient/.osv-scanner.toml b/vendor/github.com/regclient/regclient/.osv-scanner.toml index 39efeb73c..b9470dd58 100644 --- a/vendor/github.com/regclient/regclient/.osv-scanner.toml +++ b/vendor/github.com/regclient/regclient/.osv-scanner.toml @@ -1 +1 @@ -GoVersionOverride = "1.25.0" +GoVersionOverride = "1.25.4" diff --git a/vendor/github.com/regclient/regclient/.version-bump.lock b/vendor/github.com/regclient/regclient/.version-bump.lock index a31e97e5f..51c087617 100644 --- a/vendor/github.com/regclient/regclient/.version-bump.lock +++ b/vendor/github.com/regclient/regclient/.version-bump.lock @@ -1,52 +1,53 @@ -{"name":"docker-arg-alpine-digest","key":"docker.io/library/alpine:3.22.1","version":"sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1"} -{"name":"docker-arg-alpine-tag","key":"docker.io/library/alpine","version":"3.22.1"} +{"name":"docker-arg-alpine-digest","key":"docker.io/library/alpine:3.22.2","version":"sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412"} +{"name":"docker-arg-alpine-tag","key":"docker.io/library/alpine","version":"3.22.2"} {"name":"docker-arg-ecr","key":"https://github.com/awslabs/amazon-ecr-credential-helper.git","version":"v0.10.1"} {"name":"docker-arg-gcr","key":"https://github.com/GoogleCloudPlatform/docker-credential-gcr.git","version":"v2.1.30"} -{"name":"docker-arg-go-digest","key":"docker.io/library/golang:1.25.0-alpine","version":"sha256:f18a072054848d87a8077455f0ac8a25886f2397f88bfdd222d6fafbb5bba440"} -{"name":"docker-arg-go-tag","key":"docker.io/library/golang","version":"1.25.0"} +{"name":"docker-arg-go-digest","key":"docker.io/library/golang:1.25.4-alpine","version":"sha256:d3f0cf7723f3429e3f9ed846243970b20a2de7bae6a5b66fc5914e228d831bbb"} +{"name":"docker-arg-go-tag","key":"docker.io/library/golang","version":"1.25.4"} {"name":"docker-arg-lunajson","key":"https://github.com/grafi-tt/lunajson.git:master","version":"3d10600874527d71519b33ecbb314eb93ccd1df6"} {"name":"docker-arg-semver","key":"https://github.com/kikito/semver.lua.git:master","version":"a4b708ba243208d46e575da870af969dca46a94d"} -{"name":"gha-alpine-digest","key":"docker.io/library/alpine:3.22.1","version":"sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1"} +{"name":"gha-alpine-digest","key":"docker.io/library/alpine:3.22.2","version":"sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412"} {"name":"gha-alpine-tag-base","key":"docker.io/library/alpine","version":"3"} -{"name":"gha-alpine-tag-comment","key":"docker.io/library/alpine","version":"3.22.1"} -{"name":"gha-cosign-version","key":"https://github.com/sigstore/cosign.git","version":"v2.5.3"} +{"name":"gha-alpine-tag-comment","key":"docker.io/library/alpine","version":"3.22.2"} +{"name":"gha-cosign-version","key":"https://github.com/sigstore/cosign.git","version":"v2.6.1"} {"name":"gha-golang-matrix","key":"golang-matrix","version":"[\"1.24\", \"1.25\"]"} {"name":"gha-golang-release","key":"golang-latest","version":"1.25"} -{"name":"gha-syft-version","key":"docker.io/anchore/syft","version":"v1.32.0"} +{"name":"gha-syft-version","key":"docker.io/anchore/syft","version":"v1.37.0"} {"name":"gha-uses-commit","key":"https://github.com/actions/checkout.git:v5.0.0","version":"08c6903cd8c0fde910a37f88322edcfb5dd907a8"} -{"name":"gha-uses-commit","key":"https://github.com/actions/setup-go.git:v5.5.0","version":"d35c59abb061a4a6fb18e82ac0862c26744d6ab5"} -{"name":"gha-uses-commit","key":"https://github.com/actions/stale.git:v9.1.0","version":"5bef64f19d7facfb25b37b414482c7164d639639"} -{"name":"gha-uses-commit","key":"https://github.com/actions/upload-artifact.git:v4.6.2","version":"ea165f8d65b6e75b540449e92b4886f43607fa02"} -{"name":"gha-uses-commit","key":"https://github.com/anchore/sbom-action.git:v0.20.5","version":"da167eac915b4e86f08b264dbdbc867b61be6f0c"} +{"name":"gha-uses-commit","key":"https://github.com/actions/setup-go.git:v6.0.0","version":"44694675825211faa026b3c33043df3e48a5fa00"} +{"name":"gha-uses-commit","key":"https://github.com/actions/stale.git:v10.1.0","version":"5f858e3efba33a5ca4407a664cc011ad407f2008"} +{"name":"gha-uses-commit","key":"https://github.com/actions/upload-artifact.git:v5.0.0","version":"330a01c490aca151604b8cf639adc76d48f6c5d4"} +{"name":"gha-uses-commit","key":"https://github.com/anchore/sbom-action.git:v0.20.9","version":"8e94d75ddd33f69f691467e42275782e4bfefe84"} {"name":"gha-uses-commit","key":"https://github.com/docker/build-push-action.git:v6.18.0","version":"263435318d21b8e681c14492fe198d362a7d2c83"} -{"name":"gha-uses-commit","key":"https://github.com/docker/login-action.git:v3.5.0","version":"184bdaa0721073962dff0199f1fb9940f07167d1"} +{"name":"gha-uses-commit","key":"https://github.com/docker/login-action.git:v3.6.0","version":"5e57cd118135c172c3672efd75eb46360885c0ef"} {"name":"gha-uses-commit","key":"https://github.com/docker/setup-buildx-action.git:v3.11.1","version":"e468171a9de216ec08956ac3ada2f0791b6bd435"} -{"name":"gha-uses-commit","key":"https://github.com/regclient/actions.git:main","version":"03ca0eeb8348921b9447b7d5d6b6d350550ddb3b"} -{"name":"gha-uses-commit","key":"https://github.com/sigstore/cosign-installer.git:v3.9.2","version":"d58896d6a1865668819e1d91763c7751a165e159"} -{"name":"gha-uses-commit","key":"https://github.com/softprops/action-gh-release.git:v2.3.2","version":"72f2c25fcb47643c292f7107632f7a47c1df5cd8"} +{"name":"gha-uses-commit","key":"https://github.com/regclient/actions.git:main","version":"df29323daedc1f78ee74b261bd8d849327cb4ff0"} +{"name":"gha-uses-commit","key":"https://github.com/sigstore/cosign-installer.git:v4.0.0","version":"faadad0cce49287aee09b3a48701e75088a2c6ad"} +{"name":"gha-uses-commit","key":"https://github.com/softprops/action-gh-release.git:v2.4.2","version":"5be0e66d93ac7ed76da52eca8bb058f665c3a5fe"} {"name":"gha-uses-semver","key":"https://github.com/actions/checkout.git","version":"v5.0.0"} -{"name":"gha-uses-semver","key":"https://github.com/actions/setup-go.git","version":"v5.5.0"} -{"name":"gha-uses-semver","key":"https://github.com/actions/stale.git","version":"v9.1.0"} -{"name":"gha-uses-semver","key":"https://github.com/actions/upload-artifact.git","version":"v4.6.2"} -{"name":"gha-uses-semver","key":"https://github.com/anchore/sbom-action.git","version":"v0.20.5"} +{"name":"gha-uses-semver","key":"https://github.com/actions/setup-go.git","version":"v6.0.0"} +{"name":"gha-uses-semver","key":"https://github.com/actions/stale.git","version":"v10.1.0"} +{"name":"gha-uses-semver","key":"https://github.com/actions/upload-artifact.git","version":"v5.0.0"} +{"name":"gha-uses-semver","key":"https://github.com/anchore/sbom-action.git","version":"v0.20.9"} {"name":"gha-uses-semver","key":"https://github.com/docker/build-push-action.git","version":"v6.18.0"} -{"name":"gha-uses-semver","key":"https://github.com/docker/login-action.git","version":"v3.5.0"} +{"name":"gha-uses-semver","key":"https://github.com/docker/login-action.git","version":"v3.6.0"} {"name":"gha-uses-semver","key":"https://github.com/docker/setup-buildx-action.git","version":"v3.11.1"} -{"name":"gha-uses-semver","key":"https://github.com/sigstore/cosign-installer.git","version":"v3.9.2"} -{"name":"gha-uses-semver","key":"https://github.com/softprops/action-gh-release.git","version":"v2.3.2"} +{"name":"gha-uses-semver","key":"https://github.com/sigstore/cosign-installer.git","version":"v4.0.0"} +{"name":"gha-uses-semver","key":"https://github.com/softprops/action-gh-release.git","version":"v2.4.2"} {"name":"go-mod-golang-release","key":"golang-oldest","version":"1.24.0"} {"name":"makefile-ci-distribution","key":"docker.io/library/registry","version":"3.0.0"} -{"name":"makefile-ci-zot","key":"ghcr.io/project-zot/zot-linux-amd64","version":"v2.1.7"} +{"name":"makefile-ci-zot","key":"ghcr.io/project-zot/zot-linux-amd64","version":"v2.1.10"} {"name":"makefile-go-vulncheck","key":"https://go.googlesource.com/vuln.git","version":"v1.1.4"} +{"name":"makefile-gofumpt","key":"https://github.com/mvdan/gofumpt.git","version":"v0.9.2"} {"name":"makefile-gomajor","key":"https://github.com/icholy/gomajor.git","version":"v0.15.0"} -{"name":"makefile-gosec","key":"https://github.com/securego/gosec.git","version":"v2.22.8"} +{"name":"makefile-gosec","key":"https://github.com/securego/gosec.git","version":"v2.22.10"} {"name":"makefile-markdown-lint","key":"docker.io/davidanson/markdownlint-cli2","version":"v0.18.1"} -{"name":"makefile-osv-scanner","key":"https://github.com/google/osv-scanner.git","version":"v2.2.2"} +{"name":"makefile-osv-scanner","key":"https://github.com/google/osv-scanner.git","version":"v2.2.4"} {"name":"makefile-staticcheck","key":"https://github.com/dominikh/go-tools.git","version":"v0.6.1"} -{"name":"makefile-syft-container-digest","key":"anchore/syft:v1.32.0","version":"sha256:b6a6da626d98f5cb92e28934176709003cce6cdcf674816959c7d84845d94045"} -{"name":"makefile-syft-container-tag","key":"anchore/syft","version":"v1.32.0"} -{"name":"makefile-syft-version","key":"docker.io/anchore/syft","version":"v1.32.0"} -{"name":"osv-golang-release","key":"docker.io/library/golang","version":"1.25.0"} -{"name":"shell-alpine-digest","key":"docker.io/library/alpine:3.22.1","version":"sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1"} +{"name":"makefile-syft-container-digest","key":"anchore/syft:v1.37.0","version":"sha256:48d679480c6d272c1801cf30460556959c01d4826795be31d4fd8b53750b7d91"} +{"name":"makefile-syft-container-tag","key":"anchore/syft","version":"v1.37.0"} +{"name":"makefile-syft-version","key":"docker.io/anchore/syft","version":"v1.37.0"} +{"name":"osv-golang-release","key":"docker.io/library/golang","version":"1.25.4"} +{"name":"shell-alpine-digest","key":"docker.io/library/alpine:3.22.2","version":"sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412"} {"name":"shell-alpine-tag-base","key":"docker.io/library/alpine","version":"3"} -{"name":"shell-alpine-tag-comment","key":"docker.io/library/alpine","version":"3.22.1"} +{"name":"shell-alpine-tag-comment","key":"docker.io/library/alpine","version":"3.22.2"} diff --git a/vendor/github.com/regclient/regclient/.version-bump.yml b/vendor/github.com/regclient/regclient/.version-bump.yml index 762012dc2..4c92b5c85 100644 --- a/vendor/github.com/regclient/regclient/.version-bump.yml +++ b/vendor/github.com/regclient/regclient/.version-bump.yml @@ -28,6 +28,7 @@ files: - gha-alpine-digest "Makefile": processors: + - makefile-gofumpt - makefile-gomajor - makefile-go-vulncheck - makefile-markdown-lint @@ -105,6 +106,13 @@ processors: regexp: '^ARG ECR_HELPER_VER=(?Pv?\d+\.\d+\.\d+)\s*$' sourceArgs: url: "https://github.com/awslabs/amazon-ecr-credential-helper.git" + # temp hack to back rev due to missing tag on sub-module + sort: + method: "semver" + offset: 1 + # TODO: support templating the output of a filter in version-bump so versions on the sub-module can be used + # filter: + # expr: '^ecr-login/v?\d+\.\d+\.\d+$' docker-arg-gcr: <<: *git-tag-semver scanArgs: @@ -152,6 +160,8 @@ processors: regexp: '^\s*cosign-release: "(?Pv?[0-9\.]+)"\s*$' sourceArgs: url: "https://github.com/sigstore/cosign.git" + filter: + expr: '^v?2\.\d+\.\d+$' # pin to v2 pending cosign-installer upgrade gha-golang-matrix: <<: *registry-tag-semver key: "golang-matrix" @@ -222,6 +232,12 @@ processors: regexp: '^CI_ZOT_VER\?=(?Pv?[0-9\.]+)\s*$' sourceArgs: repo: "ghcr.io/project-zot/zot-linux-amd64" + makefile-gofumpt: + <<: *git-tag-semver + scanArgs: + regexp: '^GOFUMPT_VER\?=(?Pv?[0-9\.]+)\s*$' + sourceArgs: + url: "https://github.com/mvdan/gofumpt.git" makefile-gomajor: <<: *git-tag-semver scanArgs: diff --git a/vendor/github.com/regclient/regclient/Makefile b/vendor/github.com/regclient/regclient/Makefile index 5d121cce3..523982e16 100644 --- a/vendor/github.com/regclient/regclient/Makefile +++ b/vendor/github.com/regclient/regclient/Makefile @@ -36,14 +36,15 @@ ifeq "$(strip $(VER_BUMP))" '' $(VER_BUMP_CONTAINER) endif MARKDOWN_LINT_VER?=v0.18.1 +GOFUMPT_VER?=v0.9.2 GOMAJOR_VER?=v0.15.0 -GOSEC_VER?=v2.22.8 +GOSEC_VER?=v2.22.10 GO_VULNCHECK_VER?=v1.1.4 -OSV_SCANNER_VER?=v2.2.2 +OSV_SCANNER_VER?=v2.2.4 SYFT?=$(shell command -v syft 2>/dev/null) SYFT_CMD_VER:=$(shell [ -x "$(SYFT)" ] && echo "v$$($(SYFT) version | awk '/^Version: / {print $$2}')" || echo "0") -SYFT_VERSION?=v1.32.0 -SYFT_CONTAINER?=anchore/syft:v1.32.0@sha256:b6a6da626d98f5cb92e28934176709003cce6cdcf674816959c7d84845d94045 +SYFT_VERSION?=v1.37.0 +SYFT_CONTAINER?=anchore/syft:v1.37.0@sha256:48d679480c6d272c1801cf30460556959c01d4826795be31d4fd8b53750b7d91 ifneq "$(SYFT_CMD_VER)" "$(SYFT_VERSION)" SYFT=docker run --rm \ -v "$(shell pwd)/:$(shell pwd)/" -w "$(shell pwd)" \ @@ -52,18 +53,22 @@ ifneq "$(SYFT_CMD_VER)" "$(SYFT_VERSION)" endif STATICCHECK_VER?=v0.6.1 CI_DISTRIBUTION_VER?=3.0.0 -CI_ZOT_VER?=v2.1.7 +CI_ZOT_VER?=v2.1.10 .PHONY: .FORCE .FORCE: .PHONY: all -all: fmt goimports vet test lint binaries ## Full build of Go binaries (including fmt, vet, test, and lint) +all: fmt gofumpt goimports vet test lint binaries ## Full build of Go binaries (including fmt, vet, test, and lint) .PHONY: fmt fmt: ## go fmt go fmt ./... +.PHONY: gofumpt +gofumpt: $(GOPATH)/bin/gofumpt ## gofumpt is a stricter alternative to go fmt + gofumpt -l -w . + goimports: $(GOPATH)/bin/goimports $(GOPATH)/bin/goimports -w -format-only -local github.com/regclient . @@ -79,8 +84,9 @@ test: ## go test lint: lint-go lint-goimports lint-md lint-gosec ## Run all linting .PHONY: lint-go -lint-go: $(GOPATH)/bin/staticcheck .FORCE ## Run linting for Go +lint-go: $(GOPATH)/bin/gofumpt $(GOPATH)/bin/staticcheck .FORCE ## Run linting for Go $(GOPATH)/bin/staticcheck -checks all ./... + $(GOPATH)/bin/gofumpt -l -d . lint-goimports: $(GOPATH)/bin/goimports @if [ -n "$$($(GOPATH)/bin/goimports -l -format-only -local github.com/regclient .)" ]; then \ @@ -229,6 +235,11 @@ util-version-check: ## check all dependencies for updates util-version-update: ## update versions on all dependencies $(VER_BUMP) update +$(GOPATH)/bin/gofumpt: .FORCE + @[ -f "$(GOPATH)/bin/gofumpt" ] \ + && [ "$$($(GOPATH)/bin/gofumpt -version | cut -f 1 -d ' ')" = "$(GOFUMPT_VER)" ] \ + || go install mvdan.cc/gofumpt@$(GOFUMPT_VER) + $(GOPATH)/bin/gomajor: .FORCE @[ -f "$(GOPATH)/bin/gomajor" ] \ && [ "$$($(GOPATH)/bin/gomajor version | grep '^version' | cut -f 2 -d ' ')" = "$(GOMAJOR_VER)" ] \ diff --git a/vendor/github.com/regclient/regclient/config/docker.go b/vendor/github.com/regclient/regclient/config/docker.go index b6f3f2699..b4b91a0ef 100644 --- a/vendor/github.com/regclient/regclient/config/docker.go +++ b/vendor/github.com/regclient/regclient/config/docker.go @@ -7,14 +7,18 @@ import ( "fmt" "io" "io/fs" + "os" "strings" "github.com/regclient/regclient/internal/conffile" + "github.com/regclient/regclient/types/errs" ) const ( // dockerEnv is the environment variable used to look for Docker's config.json. dockerEnv = "DOCKER_CONFIG" + // dockerEnvConfig is used to inject the config as an environment variable. + dockerEnvConfig = "DOCKER_AUTH_CONFIG" // dockerDir is the directory name for Docker's config (inside the users home directory). dockerDir = ".docker" // dockerConfFile is the name of Docker's config file. @@ -59,26 +63,65 @@ type dockerAuthConfig struct { } // DockerLoad returns a slice of hosts from the users docker config. +// This will search for the config.json in either the DOCKER_CONFIG identified directory or the default .docker directory. +// It also includes hosts extracted from the DOCKER_AUTH_CONFIG variable. +// If the config file is missing and no value is injected using an environment variable, an empty list is returned. func DockerLoad() ([]Host, error) { + hosts := []Host{} + errList := []error{} + // load from a file cf := conffile.New(conffile.WithDirName(dockerDir, dockerConfFile), conffile.WithEnvDir(dockerEnv, dockerConfFile)) - return dockerParse(cf) + rdr, err := cf.Open() + if err != nil && !errors.Is(err, fs.ErrNotExist) { + errList = append(errList, err) + } else if err == nil { + defer rdr.Close() + hostsFile, err := dockerParse(rdr) + if err != nil { + errList = append(errList, err) + } else { + hosts = append(hosts, hostsFile...) + } + } + // load from an env var + hostsEnv, err := DockerLoadEnv(dockerEnvConfig) + if err != nil && !errors.Is(err, errs.ErrNotFound) { + errList = append(errList, err) + } else if err == nil { + hosts = append(hosts, hostsEnv...) + } + // return the concatenated result, only wrapping an error list if necessary + if len(errList) == 1 { + return hosts, errList[0] + } else { + return hosts, errors.Join(errList...) + } } // DockerLoadFile returns a slice of hosts from a named docker config file. func DockerLoadFile(fname string) ([]Host, error) { - cf := conffile.New(conffile.WithFullname(fname)) - return dockerParse(cf) -} - -// dockerParse parses a docker config into a slice of Hosts. -func dockerParse(cf *conffile.File) ([]Host, error) { - rdr, err := cf.Open() + //#nosec G304 scoping file operations to a directory is not yet a feature of regclient. + rdr, err := os.Open(fname) if err != nil && errors.Is(err, fs.ErrNotExist) { return []Host{}, nil } else if err != nil { return nil, err } defer rdr.Close() + return dockerParse(rdr) +} + +// DockerLoadEnv returns a slice of hosts extracted from the config injected in an environment variable. +func DockerLoadEnv(envName string) ([]Host, error) { + envVal := os.Getenv(envName) + if envVal == "" { + return []Host{}, errs.ErrNotFound + } + return dockerParse(strings.NewReader(envVal)) +} + +// dockerParse parses a docker config into a slice of Hosts. +func dockerParse(rdr io.Reader) ([]Host, error) { dc := dockerConfig{} if err := json.NewDecoder(rdr).Decode(&dc); err != nil && !errors.Is(err, io.EOF) { return nil, err diff --git a/vendor/github.com/regclient/regclient/image.go b/vendor/github.com/regclient/regclient/image.go index 696c3be4f..c282fc5ac 100644 --- a/vendor/github.com/regclient/regclient/image.go +++ b/vendor/github.com/regclient/regclient/image.go @@ -56,23 +56,26 @@ type dockerTarManifest struct { LayerSources map[digest.Digest]descriptor.Descriptor `json:",omitempty"` } -type tarFileHandler func(header *tar.Header, trd *tarReadData) error -type tarReadData struct { - tr *tar.Reader - name string - handleAdded bool - handlers map[string]tarFileHandler - links map[string][]string - processed map[string]bool - finish []func() error - // data processed from various handlers - manifests map[digest.Digest]manifest.Manifest - ociIndex v1.Index - ociManifest manifest.Manifest - dockerManifestFound bool - dockerManifestList []dockerTarManifest - dockerManifest schema2.Manifest -} +type ( + tarFileHandler func(header *tar.Header, trd *tarReadData) error + tarReadData struct { + tr *tar.Reader + name string + handleAdded bool + handlers map[string]tarFileHandler + links map[string][]string + processed map[string]bool + finish []func() error + // data processed from various handlers + manifests map[digest.Digest]manifest.Manifest + ociIndex v1.Index + ociManifest manifest.Manifest + dockerManifestFound bool + dockerManifestList []dockerTarManifest + dockerManifest schema2.Manifest + } +) + type tarWriteData struct { tw *tar.Writer dirs map[string]bool @@ -1063,7 +1066,7 @@ func (rc *RegClient) ImageExport(ctx context.Context, r ref.Ref, outStream io.Wr tw: tw, dirs: map[string]bool{}, files: map[string]bool{}, - mode: 0644, + mode: 0o644, } // retrieve image manifest @@ -1837,7 +1840,7 @@ func (td *tarWriteData) tarWriteHeader(filename string, size int64) error { Typeflag: tar.TypeDir, Name: dirJoin + "/", Size: 0, - Mode: td.mode | 0511, + Mode: td.mode | 0o511, ModTime: td.timestamp, AccessTime: td.timestamp, ChangeTime: td.timestamp, @@ -1859,7 +1862,7 @@ func (td *tarWriteData) tarWriteHeader(filename string, size int64) error { Typeflag: tar.TypeReg, Name: filename, Size: size, - Mode: td.mode | 0400, + Mode: td.mode | 0o400, ModTime: td.timestamp, AccessTime: td.timestamp, ChangeTime: td.timestamp, diff --git a/vendor/github.com/regclient/regclient/internal/auth/error.go b/vendor/github.com/regclient/regclient/internal/auth/error.go index 2ba7e3b82..7b04198a6 100644 --- a/vendor/github.com/regclient/regclient/internal/auth/error.go +++ b/vendor/github.com/regclient/regclient/internal/auth/error.go @@ -8,33 +8,41 @@ var ( // ErrEmptyChallenge indicates an issue with the received challenge in the WWW-Authenticate header // // Deprecated: replace with [errs.ErrEmptyChallenge]. + //go:fix inline ErrEmptyChallenge = errs.ErrEmptyChallenge // ErrInvalidChallenge indicates an issue with the received challenge in the WWW-Authenticate header // // Deprecated: replace with [errs.ErrInvalidChallenge]. + //go:fix inline ErrInvalidChallenge = errs.ErrInvalidChallenge // ErrNoNewChallenge indicates a challenge update did not result in any change // // Deprecated: replace with [errs.ErrNoNewChallenge]. + //go:fix inline ErrNoNewChallenge = errs.ErrNoNewChallenge // ErrNotFound indicates no credentials found for basic auth // // Deprecated: replace with [errs.ErrNotFound]. + //go:fix inline ErrNotFound = errs.ErrNotFound // ErrNotImplemented returned when method has not been implemented yet // // Deprecated: replace with [errs.ErrNotImplemented]. + //go:fix inline ErrNotImplemented = errs.ErrNotImplemented // ErrParseFailure indicates the WWW-Authenticate header could not be parsed // // Deprecated: replace with [errs.ErrParseFailure]. + //go:fix inline ErrParseFailure = errs.ErrParsingFailed // ErrUnauthorized request was not authorized // // Deprecated: replace with [errs.ErrUnauthorized]. + //go:fix inline ErrUnauthorized = errs.ErrHTTPUnauthorized // ErrUnsupported indicates the request was unsupported // // Deprecated: replace with [errs.ErrUnsupported]. + //go:fix inline ErrUnsupported = errs.ErrUnsupported ) diff --git a/vendor/github.com/regclient/regclient/internal/conffile/conffile.go b/vendor/github.com/regclient/regclient/internal/conffile/conffile.go index 433645a8b..0ed84a9e5 100644 --- a/vendor/github.com/regclient/regclient/internal/conffile/conffile.go +++ b/vendor/github.com/regclient/regclient/internal/conffile/conffile.go @@ -19,7 +19,7 @@ type Opt func(*File) // New returns a new File func New(opts ...Opt) *File { - f := File{perms: 0600} + f := File{perms: 0o600} for _, fn := range opts { fn(&f) } @@ -82,7 +82,7 @@ func (f *File) Open() (io.ReadCloser, error) { func (f *File) Write(rdr io.Reader) error { // create temp file/open dir := filepath.Dir(f.fullname) - if err := os.MkdirAll(dir, 0700); err != nil { + if err := os.MkdirAll(dir, 0o700); err != nil { return err } tmp, err := os.CreateTemp(dir, filepath.Base(f.fullname)) @@ -108,7 +108,7 @@ func (f *File) Write(rdr io.Reader) error { } // adjust file ownership/permissions - mode := os.FileMode(0600) + mode := os.FileMode(0o600) uid := os.Getuid() gid := os.Getgid() // adjust defaults based on existing file if available diff --git a/vendor/github.com/regclient/regclient/internal/httplink/httplink.go b/vendor/github.com/regclient/regclient/internal/httplink/httplink.go index 863812277..5ccd4f91d 100644 --- a/vendor/github.com/regclient/regclient/internal/httplink/httplink.go +++ b/vendor/github.com/regclient/regclient/internal/httplink/httplink.go @@ -8,11 +8,13 @@ import ( "github.com/regclient/regclient/types/errs" ) -type Links []Link -type Link struct { - URI string - Param map[string]string -} +type ( + Links []Link + Link struct { + URI string + Param map[string]string + } +) type charLU byte diff --git a/vendor/github.com/regclient/regclient/internal/reghttp/http.go b/vendor/github.com/regclient/regclient/internal/reghttp/http.go index 4774a6d6c..a9a3309fa 100644 --- a/vendor/github.com/regclient/regclient/internal/reghttp/http.go +++ b/vendor/github.com/regclient/regclient/internal/reghttp/http.go @@ -36,9 +36,11 @@ import ( "github.com/regclient/regclient/types/warning" ) -var defaultDelayInit, _ = time.ParseDuration("0.1s") -var defaultDelayMax, _ = time.ParseDuration("30s") -var warnRegexp = regexp.MustCompile(`^299\s+-\s+"([^"]+)"`) +var ( + defaultDelayInit, _ = time.ParseDuration("0.1s") + defaultDelayMax, _ = time.ParseDuration("30s") + warnRegexp = regexp.MustCompile(`^299\s+-\s+"([^"]+)"`) +) const ( DefaultRetryLimit = 5 // number of times a request will be retried @@ -428,7 +430,6 @@ func (resp *Resp) next() error { // send request hc := h.getHTTPClient(req.Repository) resp.resp, err = hc.Do(httpReq) - if err != nil { c.slog.Debug("Request failed", slog.String("URL", u.String()), diff --git a/vendor/github.com/regclient/regclient/internal/units/size.go b/vendor/github.com/regclient/regclient/internal/units/size.go index 772e48737..b1893c9f6 100644 --- a/vendor/github.com/regclient/regclient/internal/units/size.go +++ b/vendor/github.com/regclient/regclient/internal/units/size.go @@ -19,8 +19,10 @@ import ( "fmt" ) -var decimapAbbrs = []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} -var binaryAbbrs = []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"} +var ( + decimapAbbrs = []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} + binaryAbbrs = []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"} +) func getSizeAndUnit(size float64, base float64, unitList []string) (float64, string) { i := 0 diff --git a/vendor/github.com/regclient/regclient/regclient.go b/vendor/github.com/regclient/regclient/regclient.go index c1a342187..60808605f 100644 --- a/vendor/github.com/regclient/regclient/regclient.go +++ b/vendor/github.com/regclient/regclient/regclient.go @@ -2,12 +2,11 @@ package regclient import ( + "fmt" "io" "log/slog" "time" - "fmt" - "github.com/regclient/regclient/config" "github.com/regclient/regclient/internal/version" "github.com/regclient/regclient/scheme" @@ -43,7 +42,7 @@ type Opt func(*RegClient) // New returns a registry client. func New(opts ...Opt) *RegClient { - var rc = RegClient{ + rc := RegClient{ hosts: map[string]*config.Host{}, userAgent: DefaultUserAgent, regOpts: []reg.Opts{}, @@ -93,28 +92,28 @@ func New(opts ...Opt) *RegClient { // WithBlobLimit sets the max size for chunked blob uploads which get stored in memory. // // Deprecated: replace with WithRegOpts(reg.WithBlobLimit(limit)), see [WithRegOpts] and [reg.WithBlobLimit]. +// +//go:fix inline func WithBlobLimit(limit int64) Opt { - return func(rc *RegClient) { - rc.regOpts = append(rc.regOpts, reg.WithBlobLimit(limit)) - } + return WithRegOpts(reg.WithBlobLimit(limit)) } // WithBlobSize overrides default blob sizes. // // Deprecated: replace with WithRegOpts(reg.WithBlobSize(chunk, max)), see [WithRegOpts] and [reg.WithBlobSize]. +// +//go:fix inline func WithBlobSize(chunk, max int64) Opt { - return func(rc *RegClient) { - rc.regOpts = append(rc.regOpts, reg.WithBlobSize(chunk, max)) - } + return WithRegOpts(reg.WithBlobSize(chunk, max)) } // WithCertDir adds a path of certificates to trust similar to Docker's /etc/docker/certs.d. // // Deprecated: replace with WithRegOpts(reg.WithCertDirs(path)), see [WithRegOpts] and [reg.WithCertDirs]. +// +//go:fix inline func WithCertDir(path ...string) Opt { - return func(rc *RegClient) { - rc.regOpts = append(rc.regOpts, reg.WithCertDirs(path)) - } + return WithRegOpts(reg.WithCertDirs(path)) } // WithConfigHost adds a list of config host settings. @@ -134,13 +133,15 @@ func WithConfigHostDefault(configHost config.Host) Opt { // WithConfigHosts adds a list of config host settings. // // Deprecated: replace with [WithConfigHost]. +// +//go:fix inline func WithConfigHosts(configHosts []config.Host) Opt { return WithConfigHost(configHosts...) } // WithDockerCerts adds certificates trusted by docker in /etc/docker/certs.d. func WithDockerCerts() Opt { - return WithCertDir(DockerCertDir) + return WithRegOpts(reg.WithCertDirs([]string{DockerCertDir})) } // WithDockerCreds adds configuration from users docker config with registry logins. @@ -184,19 +185,19 @@ func WithRegOpts(opts ...reg.Opts) Opt { // WithRetryDelay specifies the time permitted for retry delays. // // Deprecated: replace with WithRegOpts(reg.WithDelay(delayInit, delayMax)), see [WithRegOpts] and [reg.WithDelay]. +// +//go:fix inline func WithRetryDelay(delayInit, delayMax time.Duration) Opt { - return func(rc *RegClient) { - rc.regOpts = append(rc.regOpts, reg.WithDelay(delayInit, delayMax)) - } + return WithRegOpts(reg.WithDelay(delayInit, delayMax)) } // WithRetryLimit specifies the number of retries for non-fatal errors. // // Deprecated: replace with WithRegOpts(reg.WithRetryLimit(retryLimit)), see [WithRegOpts] and [reg.WithRetryLimit]. +// +//go:fix inline func WithRetryLimit(retryLimit int) Opt { - return func(rc *RegClient) { - rc.regOpts = append(rc.regOpts, reg.WithRetryLimit(retryLimit)) - } + return WithRegOpts(reg.WithRetryLimit(retryLimit)) } // WithSlog configures the slog Logger. diff --git a/vendor/github.com/regclient/regclient/release.md b/vendor/github.com/regclient/regclient/release.md index c62e603b4..a30e591f3 100644 --- a/vendor/github.com/regclient/regclient/release.md +++ b/vendor/github.com/regclient/regclient/release.md @@ -1,20 +1,46 @@ -# Release v0.9.2 +# Release v0.10.0 -Security: +Features: + +- Feat: Support DOCKER_AUTH_CONFIG variable. ([PR 996][pr-996]) +- Feat: Add regctl repo copy. ([PR 997][pr-997]) +- Feat: regsync support for semantic versioning(semver) for matching tags ([PR 1005][pr-1005]) +- Feat: Add `tagSets` to regsync. ([PR 1008][pr-1008]) -- xz upgrade fixes CVE-2025-58058 ([PR 989][pr-989]) +Changes: -Miscellaneous: +- Chore: Add go:fix lines to deprecated code. ([PR 994][pr-994]) +- Chore: Add gofumpt to the build. ([PR 995][pr-995]) +- Chore: Remove the unused bps field. ([PR 998][pr-998]) +- Fix: Handle semver compare of numeric prerelease ([PR 1007][pr-1007]) + +Security: -- Fix CLI lint errors. ([PR 983][pr-983]) -- Cleanup version output. ([PR 985][pr-985]) -- Dockerfile cleanup. ([PR 986][pr-986]) +- CVE-2025-58187: Fixed with Go upgrade (). +- CVE-2025-58189: Fixed with Go upgrade (). +- CVE-2025-61723: Fixed with Go upgrade (). +- CVE-2025-47912: Fixed with Go upgrade (). +- CVE-2025-58185: Fixed with Go upgrade (). +- CVE-2025-58186: Fixed with Go upgrade (). +- CVE-2025-58188: Fixed with Go upgrade (). +- CVE-2025-58183: Fixed with Go upgrade (). +- CVE-2025-9230: Fixed with Alpine image upgrade. +- CVE-2025-9230: Fixed with Alpine image upgrade. +- CVE-2025-9232: Fixed with Alpine image upgrade. +- CVE-2025-9232: Fixed with Alpine image upgrade. +- CVE-2025-9231: Fixed with Alpine image upgrade. +- CVE-2025-9231: Fixed with Alpine image upgrade. Contributors: +- @daimoniac - @sudo-bmitch -[pr-983]: https://github.com/regclient/regclient/pull/983 -[pr-985]: https://github.com/regclient/regclient/pull/985 -[pr-986]: https://github.com/regclient/regclient/pull/986 -[pr-989]: https://github.com/regclient/regclient/pull/989 +[pr-994]: https://github.com/regclient/regclient/pull/994 +[pr-995]: https://github.com/regclient/regclient/pull/995 +[pr-996]: https://github.com/regclient/regclient/pull/996 +[pr-997]: https://github.com/regclient/regclient/pull/997 +[pr-998]: https://github.com/regclient/regclient/pull/998 +[pr-1005]: https://github.com/regclient/regclient/pull/1005 +[pr-1007]: https://github.com/regclient/regclient/pull/1007 +[pr-1008]: https://github.com/regclient/regclient/pull/1008 diff --git a/vendor/github.com/regclient/regclient/scheme/ocidir/blob.go b/vendor/github.com/regclient/regclient/scheme/ocidir/blob.go index a06e922e0..e4580792e 100644 --- a/vendor/github.com/regclient/regclient/scheme/ocidir/blob.go +++ b/vendor/github.com/regclient/regclient/scheme/ocidir/blob.go @@ -111,7 +111,7 @@ func (o *OCIDir) BlobPut(ctx context.Context, r ref.Ref, d descriptor.Descriptor dir := path.Join(r.Path, "blobs", d.DigestAlgo().String()) tmpPattern := "*.tmp" //#nosec G301 defer to user umask settings - err = os.MkdirAll(dir, 0777) + err = os.MkdirAll(dir, 0o777) if err != nil && !errors.Is(err, fs.ErrExist) { return d, fmt.Errorf("failed creating %s: %w", dir, err) } diff --git a/vendor/github.com/regclient/regclient/scheme/ocidir/manifest.go b/vendor/github.com/regclient/regclient/scheme/ocidir/manifest.go index 6d20ab7a5..6c2fc9fa2 100644 --- a/vendor/github.com/regclient/regclient/scheme/ocidir/manifest.go +++ b/vendor/github.com/regclient/regclient/scheme/ocidir/manifest.go @@ -249,7 +249,7 @@ func (o *OCIDir) manifestPut(ctx context.Context, r ref.Ref, m manifest.Manifest // create manifest CAS file dir := path.Join(r.Path, "blobs", desc.Digest.Algorithm().String()) //#nosec G301 defer to user umask settings - err = os.MkdirAll(dir, 0777) + err = os.MkdirAll(dir, 0o777) if err != nil && !errors.Is(err, fs.ErrExist) { return fmt.Errorf("failed creating %s: %w", dir, err) } diff --git a/vendor/github.com/regclient/regclient/scheme/ocidir/ocidir.go b/vendor/github.com/regclient/regclient/scheme/ocidir/ocidir.go index 9d592862d..f612202ea 100644 --- a/vendor/github.com/regclient/regclient/scheme/ocidir/ocidir.go +++ b/vendor/github.com/regclient/regclient/scheme/ocidir/ocidir.go @@ -150,7 +150,7 @@ func (o *OCIDir) initIndex(r ref.Ref, locked bool) error { return nil } //#nosec G301 defer to user umask settings - err = os.MkdirAll(r.Path, 0777) + err = os.MkdirAll(r.Path, 0o777) if err != nil && !errors.Is(err, fs.ErrExist) { return fmt.Errorf("failed creating %s: %w", r.Path, err) } @@ -237,7 +237,7 @@ func (o *OCIDir) writeIndex(r ref.Ref, i v1.Index, locked bool) error { defer o.mu.Unlock() } //#nosec G301 defer to user umask settings - err := os.MkdirAll(r.Path, 0777) + err := os.MkdirAll(r.Path, 0o777) if err != nil && !errors.Is(err, fs.ErrExist) { return fmt.Errorf("failed creating %s: %w", r.Path, err) } diff --git a/vendor/github.com/regclient/regclient/scheme/reg/blob.go b/vendor/github.com/regclient/regclient/scheme/reg/blob.go index bdc5ccf07..38c313b9c 100644 --- a/vendor/github.com/regclient/regclient/scheme/reg/blob.go +++ b/vendor/github.com/regclient/regclient/scheme/reg/blob.go @@ -27,9 +27,7 @@ import ( "github.com/regclient/regclient/types/warning" ) -var ( - zeroDig = digest.SHA256.FromBytes([]byte{}) -) +var zeroDig = digest.SHA256.FromBytes([]byte{}) // BlobDelete removes a blob from the repository func (reg *Reg) BlobDelete(ctx context.Context, r ref.Ref, d descriptor.Descriptor) error { diff --git a/vendor/github.com/regclient/regclient/scheme/scheme.go b/vendor/github.com/regclient/regclient/scheme/scheme.go index 84388a3bb..936bcc10f 100644 --- a/vendor/github.com/regclient/regclient/scheme/scheme.go +++ b/vendor/github.com/regclient/regclient/scheme/scheme.go @@ -117,7 +117,7 @@ type ReferrerOpts func(*ReferrerConfig) // WithReferrerMatchOpt filters results using [descriptor.MatchOpt]. func WithReferrerMatchOpt(mo descriptor.MatchOpt) ReferrerOpts { return func(config *ReferrerConfig) { - config.MatchOpt = mo + config.MatchOpt = config.MatchOpt.Merge(mo) } } @@ -140,35 +140,28 @@ func WithReferrerSource(r ref.Ref) ReferrerOpts { // WithReferrerAT filters by a specific artifactType value. // // Deprecated: replace with [WithReferrerMatchOpt]. +// +//go:fix inline func WithReferrerAT(at string) ReferrerOpts { - return func(config *ReferrerConfig) { - config.MatchOpt.ArtifactType = at - } + return WithReferrerMatchOpt(descriptor.MatchOpt{ArtifactType: at}) } // WithReferrerAnnotations filters by a list of annotations, all of which must match. // // Deprecated: replace with [WithReferrerMatchOpt]. +// +//go:fix inline func WithReferrerAnnotations(annotations map[string]string) ReferrerOpts { - return func(config *ReferrerConfig) { - if config.MatchOpt.Annotations == nil { - config.MatchOpt.Annotations = annotations - } else { - for k, v := range annotations { - config.MatchOpt.Annotations[k] = v - } - } - } + return WithReferrerMatchOpt(descriptor.MatchOpt{Annotations: annotations}) } // WithReferrerSort orders the resulting referrers listing according to a specified annotation. // // Deprecated: replace with [WithReferrerMatchOpt]. +// +//go:fix inline func WithReferrerSort(annotation string, desc bool) ReferrerOpts { - return func(config *ReferrerConfig) { - config.MatchOpt.SortAnnotation = annotation - config.MatchOpt.SortDesc = desc - } + return WithReferrerMatchOpt(descriptor.MatchOpt{SortAnnotation: annotation, SortDesc: desc}) } // ReferrerFilter filters the referrer list according to the config. diff --git a/vendor/github.com/regclient/regclient/types/blob/common.go b/vendor/github.com/regclient/regclient/types/blob/common.go index 44e652ad6..c78029c0a 100644 --- a/vendor/github.com/regclient/regclient/types/blob/common.go +++ b/vendor/github.com/regclient/regclient/types/blob/common.go @@ -33,6 +33,8 @@ func (c *BCommon) GetDescriptor() descriptor.Descriptor { // Digest returns the provided or calculated digest of the blob. // // Deprecated: Digest should be replaced by GetDescriptor().Digest, see [GetDescriptor]. +// +//go:fix inline func (c *BCommon) Digest() digest.Digest { return c.desc.Digest } @@ -40,6 +42,8 @@ func (c *BCommon) Digest() digest.Digest { // Length returns the provided or calculated length of the blob. // // Deprecated: Length should be replaced by GetDescriptor().Size, see [GetDescriptor]. +// +//go:fix inline func (c *BCommon) Length() int64 { return c.desc.Size } @@ -47,6 +51,8 @@ func (c *BCommon) Length() int64 { // MediaType returns the Content-Type header received from the registry. // // Deprecated: MediaType should be replaced by GetDescriptor().MediaType, see [GetDescriptor]. +// +//go:fix inline func (c *BCommon) MediaType() string { return c.desc.MediaType } diff --git a/vendor/github.com/regclient/regclient/types/descriptor.go b/vendor/github.com/regclient/regclient/types/descriptor.go index ad31e7e43..6cb357627 100644 --- a/vendor/github.com/regclient/regclient/types/descriptor.go +++ b/vendor/github.com/regclient/regclient/types/descriptor.go @@ -6,10 +6,12 @@ type ( // Descriptor is used in manifests to refer to content by media type, size, and digest. // // Deprecated: replace with [descriptor.Descriptor]. + //go:fix inline Descriptor = descriptor.Descriptor // MatchOpt defines conditions for a match descriptor. // // Deprecated: replace with [descriptor.MatchOpt]. + //go:fix inline MatchOpt = descriptor.MatchOpt ) @@ -17,11 +19,22 @@ var ( // EmptyData is the content of the empty JSON descriptor. See [mediatype.OCI1Empty]. // // Deprecated: replace with [descriptor.EmptyData]. + //go:fix inline EmptyData = descriptor.EmptyData // EmptyDigest is the digest of the empty JSON descriptor. See [mediatype.OCI1Empty]. // // Deprecated: replace with [descriptor.EmptyDigest]. - EmptyDigest = descriptor.EmptyDigest + //go:fix inline + EmptyDigest = descriptor.EmptyDigest + // DescriptorListFilter returns a list of descriptors from the list matching the search options. + // When opt.SortAnnotation is set, the order of descriptors with matching annotations is undefined. + // + // Deprecated: replace with [descriptor.DescriptorListFilter] + //go:fix inline DescriptorListFilter = descriptor.DescriptorListFilter + // DescriptorListSearch returns the first descriptor from the list matching the search options. + // + // Deprecated: replace with [descriptor.DescriptorListSearch] + //go:fix inline DescriptorListSearch = descriptor.DescriptorListSearch ) diff --git a/vendor/github.com/regclient/regclient/types/descriptor/descriptor.go b/vendor/github.com/regclient/regclient/types/descriptor/descriptor.go index 142269334..1b3e39412 100644 --- a/vendor/github.com/regclient/regclient/types/descriptor/descriptor.go +++ b/vendor/github.com/regclient/regclient/types/descriptor/descriptor.go @@ -3,6 +3,7 @@ package descriptor import ( "fmt" + "maps" "sort" "strings" "text/tabwriter" @@ -220,6 +221,42 @@ type MatchOpt struct { SortDesc bool // Set to true to sort in descending order } +// Merge applies changes to a MatchOpt, overwriting existing values, and returning a new MatchOpt. +func (mo MatchOpt) Merge(changes MatchOpt) MatchOpt { + ret := MatchOpt{ + ArtifactType: changes.ArtifactType, + SortAnnotation: changes.SortAnnotation, + SortDesc: changes.SortDesc, + } + if ret.ArtifactType == "" { + ret.ArtifactType = mo.ArtifactType + } + if changes.Platform != nil { + p := *changes.Platform + ret.Platform = &p + } else if mo.Platform != nil { + p := *mo.Platform + ret.Platform = &p + } + if ret.SortAnnotation == "" { + ret.SortAnnotation = mo.SortAnnotation + } + if !ret.SortDesc { + ret.SortDesc = mo.SortDesc + } + if len(mo.Annotations) > 0 { + ret.Annotations = maps.Clone(mo.Annotations) + } + if len(changes.Annotations) > 0 { + if ret.Annotations == nil { + ret.Annotations = changes.Annotations + } else { + maps.Copy(ret.Annotations, changes.Annotations) + } + } + return ret +} + // Match returns true if the descriptor matches the options, including compatible platforms. func (d Descriptor) Match(opt MatchOpt) bool { if opt.ArtifactType != "" && d.ArtifactType != opt.ArtifactType { diff --git a/vendor/github.com/regclient/regclient/types/error.go b/vendor/github.com/regclient/regclient/types/error.go index 8841d0153..135a16005 100644 --- a/vendor/github.com/regclient/regclient/types/error.go +++ b/vendor/github.com/regclient/regclient/types/error.go @@ -6,145 +6,181 @@ var ( // ErrAllRequestsFailed when there are no mirrors left to try // // Deprecated: replace with [errs.ErrAllRequestsFailed]. + //go:fix inline ErrAllRequestsFailed = errs.ErrAllRequestsFailed // ErrAPINotFound if an api is not available for the host // // Deprecated: replace with [errs.ErrAPINotFound]. + //go:fix inline ErrAPINotFound = errs.ErrAPINotFound // ErrBackoffLimit maximum backoff attempts reached // // Deprecated: replace with [errs.ErrBackoffLimit]. + //go:fix inline ErrBackoffLimit = errs.ErrBackoffLimit // ErrCanceled if the context was canceled // // Deprecated: replace with [errs.ErrCanceled]. + //go:fix inline ErrCanceled = errs.ErrCanceled // ErrDigestMismatch if the expected digest wasn't received // // Deprecated: replace with [errs.ErrDigestMismatch]. + //go:fix inline ErrDigestMismatch = errs.ErrDigestMismatch // ErrEmptyChallenge indicates an issue with the received challenge in the WWW-Authenticate header // // Deprecated: replace with [errs.ErrEmptyChallenge]. + //go:fix inline ErrEmptyChallenge = errs.ErrEmptyChallenge // ErrFileDeleted indicates a requested file has been deleted // // Deprecated: replace with [errs.ErrFileDeleted]. + //go:fix inline ErrFileDeleted = errs.ErrFileDeleted // ErrFileNotFound indicates a requested file is not found // // Deprecated: replace with [errs.ErrFileNotFound]. + //go:fix inline ErrFileNotFound = errs.ErrFileNotFound // ErrHTTPStatus if the http status code was unexpected // // Deprecated: replace with [errs.ErrHTTPStatus]. + //go:fix inline ErrHTTPStatus = errs.ErrHTTPStatus // ErrInvalidChallenge indicates an issue with the received challenge in the WWW-Authenticate header // // Deprecated: replace with [errs.ErrInvalidChallenge]. + //go:fix inline ErrInvalidChallenge = errs.ErrInvalidChallenge // ErrInvalidReference indicates the reference to an image is has an invalid syntax // // Deprecated: replace with [errs.ErrInvalidReference]. + //go:fix inline ErrInvalidReference = errs.ErrInvalidReference // ErrLoopDetected indicates a child node points back to the parent // // Deprecated: replace with [errs.ErrLoopDetected]. + //go:fix inline ErrLoopDetected = errs.ErrLoopDetected // ErrManifestNotSet indicates the manifest is not set, it must be pulled with a ManifestGet first // // Deprecated: replace with [errs.ErrManifestNotSet]. + //go:fix inline ErrManifestNotSet = errs.ErrManifestNotSet // ErrMissingAnnotation returned when a needed annotation is not found // // Deprecated: replace with [errs.ErrMissingAnnotation]. + //go:fix inline ErrMissingAnnotation = errs.ErrMissingAnnotation // ErrMissingDigest returned when image reference does not include a digest // // Deprecated: replace with [errs.ErrMissingDigest]. + //go:fix inline ErrMissingDigest = errs.ErrMissingDigest // ErrMissingLocation returned when the location header is missing // // Deprecated: replace with [errs.ErrMissingLocation]. + //go:fix inline ErrMissingLocation = errs.ErrMissingLocation // ErrMissingName returned when name missing for host // // Deprecated: replace with [errs.ErrMissingName]. + //go:fix inline ErrMissingName = errs.ErrMissingName // ErrMissingTag returned when image reference does not include a tag // // Deprecated: replace with [errs.ErrMissingTag]. + //go:fix inline ErrMissingTag = errs.ErrMissingTag // ErrMissingTagOrDigest returned when image reference does not include a tag or digest // // Deprecated: replace with [errs.ErrMissingTagOrDigest]. + //go:fix inline ErrMissingTagOrDigest = errs.ErrMissingTagOrDigest // ErrMismatch returned when a comparison detects a difference // // Deprecated: replace with [errs.ErrMismatch]. + //go:fix inline ErrMismatch = errs.ErrMismatch // ErrMountReturnedLocation when a blob mount fails but a location header is received // // Deprecated: replace with [errs.ErrMountReturnedLocation]. + //go:fix inline ErrMountReturnedLocation = errs.ErrMountReturnedLocation // ErrNoNewChallenge indicates a challenge update did not result in any change // // Deprecated: replace with [errs.ErrNoNewChallenge]. + //go:fix inline ErrNoNewChallenge = errs.ErrNoNewChallenge // ErrNotFound isn't there, search for your value elsewhere // // Deprecated: replace with [errs.ErrNotFound]. + //go:fix inline ErrNotFound = errs.ErrNotFound // ErrNotImplemented returned when method has not been implemented yet // // Deprecated: replace with [errs.ErrNotImplemented]. + //go:fix inline ErrNotImplemented = errs.ErrNotImplemented // ErrNotRetryable indicates the process cannot be retried // // Deprecated: replace with [errs.ErrNotRetryable]. + //go:fix inline ErrNotRetryable = errs.ErrNotRetryable // ErrParsingFailed when a string cannot be parsed // // Deprecated: replace with [errs.ErrParsingFailed]. + //go:fix inline ErrParsingFailed = errs.ErrParsingFailed // ErrRetryNeeded indicates a request needs to be retried // // Deprecated: replace with [errs.ErrRetryNeeded]. + //go:fix inline ErrRetryNeeded = errs.ErrRetryNeeded // ErrShortRead if contents are less than expected the size // // Deprecated: replace with [errs.ErrShortRead]. + //go:fix inline ErrShortRead = errs.ErrShortRead // ErrSizeLimitExceeded if contents exceed the size limit // // Deprecated: replace with [errs.ErrSizeLimitExceeded]. + //go:fix inline ErrSizeLimitExceeded = errs.ErrSizeLimitExceeded // ErrUnavailable when a requested value is not available // // Deprecated: replace with [errs.ErrUnavailable]. + //go:fix inline ErrUnavailable = errs.ErrUnavailable // ErrUnsupported indicates the request was unsupported // // Deprecated: replace with [errs.ErrUnsupported]. + //go:fix inline ErrUnsupported = errs.ErrUnsupported // ErrUnsupportedAPI happens when an API is not supported on a registry // // Deprecated: replace with [errs.ErrUnsupportedAPI]. + //go:fix inline ErrUnsupportedAPI = errs.ErrUnsupportedAPI // ErrUnsupportedConfigVersion happens when config file version is greater than this command supports // // Deprecated: replace with [errs.ErrUnsupportedConfigVersion]. + //go:fix inline ErrUnsupportedConfigVersion = errs.ErrUnsupportedConfigVersion // ErrUnsupportedMediaType returned when media type is unknown or unsupported // // Deprecated: replace with [errs.ErrUnsupportedMediaType]. + //go:fix inline ErrUnsupportedMediaType = errs.ErrUnsupportedMediaType // ErrHTTPRateLimit when requests exceed server rate limit // // Deprecated: replace with [errs.ErrHTTPRateLimit]. + //go:fix inline ErrHTTPRateLimit = errs.ErrHTTPRateLimit // ErrHTTPUnauthorized when authentication fails // // Deprecated: replace with [errs.ErrHTTPUnauthorized]. + //go:fix inline ErrHTTPUnauthorized = errs.ErrHTTPUnauthorized ) diff --git a/vendor/github.com/regclient/regclient/types/manifest/docker1.go b/vendor/github.com/regclient/regclient/types/manifest/docker1.go index 9a9935574..b45e37fe8 100644 --- a/vendor/github.com/regclient/regclient/types/manifest/docker1.go +++ b/vendor/github.com/regclient/regclient/types/manifest/docker1.go @@ -38,12 +38,15 @@ type docker1SignedManifest struct { func (m *docker1Manifest) GetConfig() (descriptor.Descriptor, error) { return descriptor.Descriptor{}, fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker1Manifest) GetConfigDigest() (digest.Digest, error) { return "", fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker1SignedManifest) GetConfig() (descriptor.Descriptor, error) { return descriptor.Descriptor{}, fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker1SignedManifest) GetConfigDigest() (digest.Digest, error) { return "", fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -51,6 +54,7 @@ func (m *docker1SignedManifest) GetConfigDigest() (digest.Digest, error) { func (m *docker1Manifest) GetManifestList() ([]descriptor.Descriptor, error) { return []descriptor.Descriptor{}, fmt.Errorf("platform descriptor list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker1SignedManifest) GetManifestList() ([]descriptor.Descriptor, error) { return []descriptor.Descriptor{}, fmt.Errorf("platform descriptor list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -68,6 +72,7 @@ func (m *docker1Manifest) GetLayers() ([]descriptor.Descriptor, error) { } return dl, nil } + func (m *docker1SignedManifest) GetLayers() ([]descriptor.Descriptor, error) { if !m.manifSet { return []descriptor.Descriptor{}, errs.ErrManifestNotSet @@ -85,6 +90,7 @@ func (m *docker1SignedManifest) GetLayers() ([]descriptor.Descriptor, error) { func (m *docker1Manifest) GetOrig() any { return m.Manifest } + func (m *docker1SignedManifest) GetOrig() any { return m.SignedManifest } @@ -92,6 +98,7 @@ func (m *docker1SignedManifest) GetOrig() any { func (m *docker1Manifest) GetPlatformDesc(p *platform.Platform) (*descriptor.Descriptor, error) { return nil, fmt.Errorf("platform lookup not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker1SignedManifest) GetPlatformDesc(p *platform.Platform) (*descriptor.Descriptor, error) { return nil, fmt.Errorf("platform lookup not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -99,6 +106,7 @@ func (m *docker1SignedManifest) GetPlatformDesc(p *platform.Platform) (*descript func (m *docker1Manifest) GetPlatformList() ([]*platform.Platform, error) { return nil, fmt.Errorf("platform list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker1SignedManifest) GetPlatformList() ([]*platform.Platform, error) { return nil, fmt.Errorf("platform list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -150,6 +158,7 @@ func (m *docker1Manifest) MarshalPretty() ([]byte, error) { err := tw.Flush() return buf.Bytes(), err } + func (m *docker1SignedManifest) MarshalPretty() ([]byte, error) { if m == nil { return []byte{}, nil diff --git a/vendor/github.com/regclient/regclient/types/manifest/docker2.go b/vendor/github.com/regclient/regclient/types/manifest/docker2.go index 780f121cc..5fce95090 100644 --- a/vendor/github.com/regclient/regclient/types/manifest/docker2.go +++ b/vendor/github.com/regclient/regclient/types/manifest/docker2.go @@ -43,27 +43,32 @@ func (m *docker2Manifest) GetAnnotations() (map[string]string, error) { } return m.Annotations, nil } + func (m *docker2Manifest) GetConfig() (descriptor.Descriptor, error) { if !m.manifSet { return descriptor.Descriptor{}, errs.ErrManifestNotSet } return m.Config, nil } + func (m *docker2Manifest) GetConfigDigest() (digest.Digest, error) { if !m.manifSet { return digest.Digest(""), errs.ErrManifestNotSet } return m.Config.Digest, nil } + func (m *docker2ManifestList) GetAnnotations() (map[string]string, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet } return m.Annotations, nil } + func (m *docker2ManifestList) GetConfig() (descriptor.Descriptor, error) { return descriptor.Descriptor{}, fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker2ManifestList) GetConfigDigest() (digest.Digest, error) { return "", fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -71,6 +76,7 @@ func (m *docker2ManifestList) GetConfigDigest() (digest.Digest, error) { func (m *docker2Manifest) GetManifestList() ([]descriptor.Descriptor, error) { return []descriptor.Descriptor{}, fmt.Errorf("platform descriptor list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker2ManifestList) GetManifestList() ([]descriptor.Descriptor, error) { if !m.manifSet { return []descriptor.Descriptor{}, errs.ErrManifestNotSet @@ -84,6 +90,7 @@ func (m *docker2Manifest) GetLayers() ([]descriptor.Descriptor, error) { } return m.Layers, nil } + func (m *docker2ManifestList) GetLayers() ([]descriptor.Descriptor, error) { return []descriptor.Descriptor{}, fmt.Errorf("layers are not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -91,6 +98,7 @@ func (m *docker2ManifestList) GetLayers() ([]descriptor.Descriptor, error) { func (m *docker2Manifest) GetOrig() any { return m.Manifest } + func (m *docker2ManifestList) GetOrig() any { return m.ManifestList } @@ -98,6 +106,7 @@ func (m *docker2ManifestList) GetOrig() any { func (m *docker2Manifest) GetPlatformDesc(p *platform.Platform) (*descriptor.Descriptor, error) { return nil, fmt.Errorf("platform lookup not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker2ManifestList) GetPlatformDesc(p *platform.Platform) (*descriptor.Descriptor, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet @@ -115,6 +124,7 @@ func (m *docker2ManifestList) GetPlatformDesc(p *platform.Platform) (*descriptor func (m *docker2Manifest) GetPlatformList() ([]*platform.Platform, error) { return nil, fmt.Errorf("platform list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *docker2ManifestList) GetPlatformList() ([]*platform.Platform, error) { dl, err := m.GetManifestList() if err != nil { @@ -144,6 +154,7 @@ func (m *docker2Manifest) MarshalJSON() ([]byte, error) { } return json.Marshal((m.Manifest)) } + func (m *docker2ManifestList) MarshalJSON() ([]byte, error) { if !m.manifSet { return []byte{}, errs.ErrManifestNotSet @@ -200,6 +211,7 @@ func (m *docker2Manifest) MarshalPretty() ([]byte, error) { err = tw.Flush() return buf.Bytes(), err } + func (m *docker2ManifestList) MarshalPretty() ([]byte, error) { if m == nil { return []byte{}, nil @@ -255,6 +267,7 @@ func (m *docker2Manifest) SetAnnotation(key, val string) error { } return m.updateDesc() } + func (m *docker2ManifestList) SetAnnotation(key, val string) error { if !m.manifSet { return errs.ErrManifestNotSet @@ -335,6 +348,7 @@ func (m *docker2Manifest) updateDesc() error { } return nil } + func (m *docker2ManifestList) updateDesc() error { mj, err := json.Marshal(m.ManifestList) if err != nil { @@ -347,5 +361,4 @@ func (m *docker2ManifestList) updateDesc() error { Size: int64(len(mj)), } return nil - } diff --git a/vendor/github.com/regclient/regclient/types/manifest/oci1.go b/vendor/github.com/regclient/regclient/types/manifest/oci1.go index 1c49b9fd4..4491960f6 100644 --- a/vendor/github.com/regclient/regclient/types/manifest/oci1.go +++ b/vendor/github.com/regclient/regclient/types/manifest/oci1.go @@ -49,39 +49,47 @@ func (m *oci1Manifest) GetAnnotations() (map[string]string, error) { } return m.Annotations, nil } + func (m *oci1Manifest) GetConfig() (descriptor.Descriptor, error) { if !m.manifSet { return descriptor.Descriptor{}, errs.ErrManifestNotSet } return m.Config, nil } + func (m *oci1Manifest) GetConfigDigest() (digest.Digest, error) { if !m.manifSet { return digest.Digest(""), errs.ErrManifestNotSet } return m.Config.Digest, nil } + func (m *oci1Index) GetAnnotations() (map[string]string, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet } return m.Annotations, nil } + func (m *oci1Index) GetConfig() (descriptor.Descriptor, error) { return descriptor.Descriptor{}, fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *oci1Index) GetConfigDigest() (digest.Digest, error) { return "", fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *oci1Artifact) GetAnnotations() (map[string]string, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet } return m.Annotations, nil } + func (m *oci1Artifact) GetConfig() (descriptor.Descriptor, error) { return descriptor.Descriptor{}, fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *oci1Artifact) GetConfigDigest() (digest.Digest, error) { return "", fmt.Errorf("config digest not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -89,12 +97,14 @@ func (m *oci1Artifact) GetConfigDigest() (digest.Digest, error) { func (m *oci1Manifest) GetManifestList() ([]descriptor.Descriptor, error) { return []descriptor.Descriptor{}, fmt.Errorf("platform descriptor list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *oci1Index) GetManifestList() ([]descriptor.Descriptor, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet } return m.Manifests, nil } + func (m *oci1Artifact) GetManifestList() ([]descriptor.Descriptor, error) { return []descriptor.Descriptor{}, fmt.Errorf("platform descriptor list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -105,9 +115,11 @@ func (m *oci1Manifest) GetLayers() ([]descriptor.Descriptor, error) { } return m.Layers, nil } + func (m *oci1Index) GetLayers() ([]descriptor.Descriptor, error) { return []descriptor.Descriptor{}, fmt.Errorf("layers are not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *oci1Artifact) GetLayers() ([]descriptor.Descriptor, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet @@ -118,9 +130,11 @@ func (m *oci1Artifact) GetLayers() ([]descriptor.Descriptor, error) { func (m *oci1Manifest) GetOrig() any { return m.Manifest } + func (m *oci1Index) GetOrig() any { return m.Index } + func (m *oci1Artifact) GetOrig() any { return m.ArtifactManifest } @@ -128,6 +142,7 @@ func (m *oci1Artifact) GetOrig() any { func (m *oci1Manifest) GetPlatformDesc(p *platform.Platform) (*descriptor.Descriptor, error) { return nil, fmt.Errorf("platform lookup not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *oci1Index) GetPlatformDesc(p *platform.Platform) (*descriptor.Descriptor, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet @@ -141,6 +156,7 @@ func (m *oci1Index) GetPlatformDesc(p *platform.Platform) (*descriptor.Descripto } return &d, nil } + func (m *oci1Artifact) GetPlatformDesc(p *platform.Platform) (*descriptor.Descriptor, error) { return nil, fmt.Errorf("platform lookup not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -148,6 +164,7 @@ func (m *oci1Artifact) GetPlatformDesc(p *platform.Platform) (*descriptor.Descri func (m *oci1Manifest) GetPlatformList() ([]*platform.Platform, error) { return nil, fmt.Errorf("platform list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } + func (m *oci1Index) GetPlatformList() ([]*platform.Platform, error) { dl, err := m.GetManifestList() if err != nil { @@ -155,6 +172,7 @@ func (m *oci1Index) GetPlatformList() ([]*platform.Platform, error) { } return getPlatformList(dl) } + func (m *oci1Artifact) GetPlatformList() ([]*platform.Platform, error) { return nil, fmt.Errorf("platform list not available for media type %s%.0w", m.desc.MediaType, errs.ErrUnsupportedMediaType) } @@ -170,18 +188,21 @@ func (m *oci1Manifest) MarshalJSON() ([]byte, error) { return json.Marshal((m.Manifest)) } + func (m *oci1Manifest) GetSubject() (*descriptor.Descriptor, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet } return m.Manifest.Subject, nil } + func (m *oci1Index) GetSubject() (*descriptor.Descriptor, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet } return m.Index.Subject, nil } + func (m *oci1Artifact) GetSubject() (*descriptor.Descriptor, error) { if !m.manifSet { return nil, errs.ErrManifestNotSet @@ -200,6 +221,7 @@ func (m *oci1Index) MarshalJSON() ([]byte, error) { return json.Marshal((m.Index)) } + func (m *oci1Artifact) MarshalJSON() ([]byte, error) { if !m.manifSet { return []byte{}, errs.ErrManifestNotSet @@ -269,6 +291,7 @@ func (m *oci1Manifest) MarshalPretty() ([]byte, error) { err = tw.Flush() return buf.Bytes(), err } + func (m *oci1Index) MarshalPretty() ([]byte, error) { if m == nil { return []byte{}, nil @@ -320,6 +343,7 @@ func (m *oci1Index) MarshalPretty() ([]byte, error) { err := tw.Flush() return buf.Bytes(), err } + func (m *oci1Artifact) MarshalPretty() ([]byte, error) { if m == nil { return []byte{}, nil @@ -384,6 +408,7 @@ func (m *oci1Manifest) SetAnnotation(key, val string) error { } return m.updateDesc() } + func (m *oci1Index) SetAnnotation(key, val string) error { if !m.manifSet { return errs.ErrManifestNotSet @@ -398,6 +423,7 @@ func (m *oci1Index) SetAnnotation(key, val string) error { } return m.updateDesc() } + func (m *oci1Artifact) SetAnnotation(key, val string) error { if !m.manifSet { return errs.ErrManifestNotSet @@ -510,6 +536,7 @@ func (m *oci1Artifact) SetSubject(d *descriptor.Descriptor) error { m.ArtifactManifest.Subject = d return m.updateDesc() } + func (m *oci1Manifest) SetSubject(d *descriptor.Descriptor) error { if !m.manifSet { return errs.ErrManifestNotSet @@ -517,6 +544,7 @@ func (m *oci1Manifest) SetSubject(d *descriptor.Descriptor) error { m.Manifest.Subject = d return m.updateDesc() } + func (m *oci1Index) SetSubject(d *descriptor.Descriptor) error { if !m.manifSet { return errs.ErrManifestNotSet @@ -553,6 +581,7 @@ func (m *oci1Manifest) updateDesc() error { } return nil } + func (m *oci1Index) updateDesc() error { mj, err := json.Marshal(m.Index) if err != nil { @@ -566,6 +595,7 @@ func (m *oci1Index) updateDesc() error { } return nil } + func (m *oci1Artifact) updateDesc() error { mj, err := json.Marshal(m.ArtifactManifest) if err != nil { diff --git a/vendor/github.com/regclient/regclient/types/mediatype.go b/vendor/github.com/regclient/regclient/types/mediatype.go index d80acde8d..220759f8f 100644 --- a/vendor/github.com/regclient/regclient/types/mediatype.go +++ b/vendor/github.com/regclient/regclient/types/mediatype.go @@ -8,84 +8,103 @@ const ( // MediaTypeDocker1Manifest deprecated media type for docker schema1 manifests. // // Deprecated: replace with [mediatype.Docker1Manifest]. + //go:fix inline MediaTypeDocker1Manifest = mediatype.Docker1Manifest // MediaTypeDocker1ManifestSigned is a deprecated schema1 manifest with jws signing. // // Deprecated: replace with [mediatype.Docker1ManifestSigned]. + //go:fix inline MediaTypeDocker1ManifestSigned = mediatype.Docker1ManifestSigned // MediaTypeDocker2Manifest is the media type when pulling manifests from a v2 registry. // // Deprecated: replace with [mediatype.Docker2Manifest]. + //go:fix inline MediaTypeDocker2Manifest = mediatype.Docker2Manifest // MediaTypeDocker2ManifestList is the media type when pulling a manifest list from a v2 registry. // // Deprecated: replace with [mediatype.Docker2ManifestList]. + //go:fix inline MediaTypeDocker2ManifestList = mediatype.Docker2ManifestList // MediaTypeDocker2ImageConfig is for the configuration json object media type. // // Deprecated: replace with [mediatype.Docker2ImageConfig]. + //go:fix inline MediaTypeDocker2ImageConfig = mediatype.Docker2ImageConfig // MediaTypeOCI1Artifact EXPERIMENTAL OCI v1 artifact media type. // // Deprecated: replace with [mediatype.OCI1Artifact]. + //go:fix inline MediaTypeOCI1Artifact = mediatype.OCI1Artifact // MediaTypeOCI1Manifest OCI v1 manifest media type. // // Deprecated: replace with [mediatype.OCI1Manifest]. + //go:fix inline MediaTypeOCI1Manifest = mediatype.OCI1Manifest // MediaTypeOCI1ManifestList OCI v1 manifest list media type. // // Deprecated: replace with [mediatype.OCI1ManifestList]. + //go:fix inline MediaTypeOCI1ManifestList = mediatype.OCI1ManifestList // MediaTypeOCI1ImageConfig OCI v1 configuration json object media type. // // Deprecated: replace with [mediatype.OCI1ImageConfig]. + //go:fix inline MediaTypeOCI1ImageConfig = mediatype.OCI1ImageConfig // MediaTypeDocker2LayerGzip is the default compressed layer for docker schema2. // // Deprecated: replace with [mediatype.Docker2LayerGzip]. + //go:fix inline MediaTypeDocker2LayerGzip = mediatype.Docker2LayerGzip // MediaTypeDocker2ForeignLayer is the default compressed layer for foreign layers in docker schema2. // // Deprecated: replace with [mediatype.Docker2ForeignLayer]. + //go:fix inline MediaTypeDocker2ForeignLayer = mediatype.Docker2ForeignLayer // MediaTypeOCI1Layer is the uncompressed layer for OCIv1. // // Deprecated: replace with [mediatype.OCI1Layer]. + //go:fix inline MediaTypeOCI1Layer = mediatype.OCI1Layer // MediaTypeOCI1LayerGzip is the gzip compressed layer for OCI v1. // // Deprecated: replace with [mediatype.OCI1LayerGzip]. + //go:fix inline MediaTypeOCI1LayerGzip = mediatype.OCI1LayerGzip // MediaTypeOCI1LayerZstd is the zstd compressed layer for OCI v1. // // Deprecated: replace with [mediatype.OCI1LayerZstd]. + //go:fix inline MediaTypeOCI1LayerZstd = mediatype.OCI1LayerZstd // MediaTypeOCI1ForeignLayer is the foreign layer for OCI v1. // // Deprecated: replace with [mediatype.OCI1ForeignLayer]. + //go:fix inline MediaTypeOCI1ForeignLayer = mediatype.OCI1ForeignLayer // MediaTypeOCI1ForeignLayerGzip is the gzip compressed foreign layer for OCI v1. // // Deprecated: replace with [mediatype.OCI1ForeignLayerGzip]. + //go:fix inline MediaTypeOCI1ForeignLayerGzip = mediatype.OCI1ForeignLayerGzip // MediaTypeOCI1ForeignLayerZstd is the zstd compressed foreign layer for OCI v1. // // Deprecated: replace with [mediatype.OCI1ForeignLayerZstd]. + //go:fix inline MediaTypeOCI1ForeignLayerZstd = mediatype.OCI1ForeignLayerZstd // MediaTypeOCI1Empty is used for blobs containing the empty JSON data `{}`. // // Deprecated: replace with [mediatype.OCI1Empty]. + //go:fix inline MediaTypeOCI1Empty = mediatype.OCI1Empty // MediaTypeBuildkitCacheConfig is used by buildkit cache images. // // Deprecated: replace with [mediatype.BuildkitCacheConfig]. + //go:fix inline MediaTypeBuildkitCacheConfig = mediatype.BuildkitCacheConfig ) -var ( - // Base cleans the Content-Type header to return only the lower case base media type. - // - // Deprecated: replace with [mediatype.Base]. - MediaTypeBase = mediatype.Base -) +// MediaTypeBase cleans the Content-Type header to return only the lower case base media type. +// +// Deprecated: replace with [mediatype.Base]. +// +//go:fix inline +var MediaTypeBase = mediatype.Base diff --git a/vendor/github.com/regclient/regclient/types/platform/cpuinfo_x86.go b/vendor/github.com/regclient/regclient/types/platform/cpuinfo_x86.go index 8e3ba7e5d..75f9e57ce 100644 --- a/vendor/github.com/regclient/regclient/types/platform/cpuinfo_x86.go +++ b/vendor/github.com/regclient/regclient/types/platform/cpuinfo_x86.go @@ -95,6 +95,7 @@ func lookupCPUVariant() string { func bitSet(bitpos uint) uint32 { return 1 << bitpos } + func bitIsSet(bits, value uint32) bool { return (value & bits) == bits } diff --git a/vendor/github.com/regclient/regclient/types/platform/platform.go b/vendor/github.com/regclient/regclient/types/platform/platform.go index 3137774b1..7cf746e8e 100644 --- a/vendor/github.com/regclient/regclient/types/platform/platform.go +++ b/vendor/github.com/regclient/regclient/types/platform/platform.go @@ -26,9 +26,7 @@ import ( "github.com/regclient/regclient/types/errs" ) -var ( - partRE = regexp.MustCompile(`^[A-Za-z0-9_-]+$`) -) +var partRE = regexp.MustCompile(`^[A-Za-z0-9_-]+$`) // Platform specifies a platform where a particular image manifest is applicable. type Platform struct { diff --git a/vendor/github.com/regclient/regclient/types/repo/repolist.go b/vendor/github.com/regclient/regclient/types/repo/repolist.go index 6d04abaed..0bdbb5ce4 100644 --- a/vendor/github.com/regclient/regclient/types/repo/repolist.go +++ b/vendor/github.com/regclient/regclient/types/repo/repolist.go @@ -71,16 +71,19 @@ func WithHeaders(header http.Header) Opts { c.header = header } } + func WithHost(host string) Opts { return func(c *repoConfig) { c.host = host } } + func WithMT(mt string) Opts { return func(c *repoConfig) { c.mt = mt } } + func WithRaw(raw []byte) Opts { return func(c *repoConfig) { c.raw = raw diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go index eeed1e92b..2fd3c5759 100644 --- a/vendor/github.com/spf13/pflag/flag.go +++ b/vendor/github.com/spf13/pflag/flag.go @@ -143,8 +143,9 @@ type ParseErrorsAllowlist struct { UnknownFlags bool } -// DEPRECATED: please use ParseErrorsAllowlist instead -// This type will be removed in a future release +// ParseErrorsWhitelist defines the parsing errors that can be ignored. +// +// Deprecated: use [ParseErrorsAllowlist] instead. This type will be removed in a future release. type ParseErrorsWhitelist = ParseErrorsAllowlist // NormalizedName is a flag name that has been normalized according to rules @@ -165,8 +166,9 @@ type FlagSet struct { // ParseErrorsAllowlist is used to configure an allowlist of errors ParseErrorsAllowlist ParseErrorsAllowlist - // DEPRECATED: please use ParseErrorsAllowlist instead - // This field will be removed in a future release + // ParseErrorsAllowlist is used to configure an allowlist of errors. + // + // Deprecated: use [FlagSet.ParseErrorsAllowlist] instead. This field will be removed in a future release. ParseErrorsWhitelist ParseErrorsAllowlist name string @@ -1185,7 +1187,7 @@ func (f *FlagSet) Parse(arguments []string) error { case ContinueOnError: return err case ExitOnError: - if errors.Is(err, ErrHelp) { + if err == ErrHelp { os.Exit(0) } fmt.Fprintln(f.Output(), err) @@ -1214,7 +1216,7 @@ func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) case ContinueOnError: return err case ExitOnError: - if errors.Is(err, ErrHelp) { + if err == ErrHelp { os.Exit(0) } fmt.Fprintln(f.Output(), err) diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index d1c8b2640..42517077c 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -226,6 +226,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -529,6 +530,7 @@ ccflags="$@" $2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ || $2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ || $2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ || + $2 ~ /^(DT|EI|ELF|EV|NN|NT|PF|SHF|SHN|SHT|STB|STT|VER)_/ || $2 ~ /^O?XTABS$/ || $2 ~ /^TC[IO](ON|OFF)$/ || $2 ~ /^IN_/ || diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 9439af961..06c0eea6f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -2643,3 +2643,9 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) //sys Mseal(b []byte, flags uint) (err error) + +//sys setMemPolicy(mode int, mask *CPUSet, size int) (err error) = SYS_SET_MEMPOLICY + +func SetMemPolicy(mode int, mask *CPUSet) error { + return setMemPolicy(mode, mask, _CPU_SETSIZE) +} diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index b6db27d93..d0a75da57 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -853,20 +853,86 @@ const ( DM_VERSION_MAJOR = 0x4 DM_VERSION_MINOR = 0x32 DM_VERSION_PATCHLEVEL = 0x0 + DT_ADDRRNGHI = 0x6ffffeff + DT_ADDRRNGLO = 0x6ffffe00 DT_BLK = 0x6 DT_CHR = 0x2 + DT_DEBUG = 0x15 DT_DIR = 0x4 + DT_ENCODING = 0x20 DT_FIFO = 0x1 + DT_FINI = 0xd + DT_FLAGS_1 = 0x6ffffffb + DT_GNU_HASH = 0x6ffffef5 + DT_HASH = 0x4 + DT_HIOS = 0x6ffff000 + DT_HIPROC = 0x7fffffff + DT_INIT = 0xc + DT_JMPREL = 0x17 DT_LNK = 0xa + DT_LOOS = 0x6000000d + DT_LOPROC = 0x70000000 + DT_NEEDED = 0x1 + DT_NULL = 0x0 + DT_PLTGOT = 0x3 + DT_PLTREL = 0x14 + DT_PLTRELSZ = 0x2 DT_REG = 0x8 + DT_REL = 0x11 + DT_RELA = 0x7 + DT_RELACOUNT = 0x6ffffff9 + DT_RELAENT = 0x9 + DT_RELASZ = 0x8 + DT_RELCOUNT = 0x6ffffffa + DT_RELENT = 0x13 + DT_RELSZ = 0x12 + DT_RPATH = 0xf DT_SOCK = 0xc + DT_SONAME = 0xe + DT_STRSZ = 0xa + DT_STRTAB = 0x5 + DT_SYMBOLIC = 0x10 + DT_SYMENT = 0xb + DT_SYMTAB = 0x6 + DT_TEXTREL = 0x16 DT_UNKNOWN = 0x0 + DT_VALRNGHI = 0x6ffffdff + DT_VALRNGLO = 0x6ffffd00 + DT_VERDEF = 0x6ffffffc + DT_VERDEFNUM = 0x6ffffffd + DT_VERNEED = 0x6ffffffe + DT_VERNEEDNUM = 0x6fffffff + DT_VERSYM = 0x6ffffff0 DT_WHT = 0xe ECHO = 0x8 ECRYPTFS_SUPER_MAGIC = 0xf15f EFD_SEMAPHORE = 0x1 EFIVARFS_MAGIC = 0xde5e81e4 EFS_SUPER_MAGIC = 0x414a53 + EI_CLASS = 0x4 + EI_DATA = 0x5 + EI_MAG0 = 0x0 + EI_MAG1 = 0x1 + EI_MAG2 = 0x2 + EI_MAG3 = 0x3 + EI_NIDENT = 0x10 + EI_OSABI = 0x7 + EI_PAD = 0x8 + EI_VERSION = 0x6 + ELFCLASS32 = 0x1 + ELFCLASS64 = 0x2 + ELFCLASSNONE = 0x0 + ELFCLASSNUM = 0x3 + ELFDATA2LSB = 0x1 + ELFDATA2MSB = 0x2 + ELFDATANONE = 0x0 + ELFMAG = "\177ELF" + ELFMAG0 = 0x7f + ELFMAG1 = 'E' + ELFMAG2 = 'L' + ELFMAG3 = 'F' + ELFOSABI_LINUX = 0x3 + ELFOSABI_NONE = 0x0 EM_386 = 0x3 EM_486 = 0x6 EM_68K = 0x4 @@ -1152,14 +1218,24 @@ const ( ETH_P_WCCP = 0x883e ETH_P_X25 = 0x805 ETH_P_XDSA = 0xf8 + ET_CORE = 0x4 + ET_DYN = 0x3 + ET_EXEC = 0x2 + ET_HIPROC = 0xffff + ET_LOPROC = 0xff00 + ET_NONE = 0x0 + ET_REL = 0x1 EV_ABS = 0x3 EV_CNT = 0x20 + EV_CURRENT = 0x1 EV_FF = 0x15 EV_FF_STATUS = 0x17 EV_KEY = 0x1 EV_LED = 0x11 EV_MAX = 0x1f EV_MSC = 0x4 + EV_NONE = 0x0 + EV_NUM = 0x2 EV_PWR = 0x16 EV_REL = 0x2 EV_REP = 0x14 @@ -2276,7 +2352,167 @@ const ( NLM_F_REPLACE = 0x100 NLM_F_REQUEST = 0x1 NLM_F_ROOT = 0x100 + NN_386_IOPERM = "LINUX" + NN_386_TLS = "LINUX" + NN_ARC_V2 = "LINUX" + NN_ARM_FPMR = "LINUX" + NN_ARM_GCS = "LINUX" + NN_ARM_HW_BREAK = "LINUX" + NN_ARM_HW_WATCH = "LINUX" + NN_ARM_PACA_KEYS = "LINUX" + NN_ARM_PACG_KEYS = "LINUX" + NN_ARM_PAC_ENABLED_KEYS = "LINUX" + NN_ARM_PAC_MASK = "LINUX" + NN_ARM_POE = "LINUX" + NN_ARM_SSVE = "LINUX" + NN_ARM_SVE = "LINUX" + NN_ARM_SYSTEM_CALL = "LINUX" + NN_ARM_TAGGED_ADDR_CTRL = "LINUX" + NN_ARM_TLS = "LINUX" + NN_ARM_VFP = "LINUX" + NN_ARM_ZA = "LINUX" + NN_ARM_ZT = "LINUX" + NN_AUXV = "CORE" + NN_FILE = "CORE" + NN_GNU_PROPERTY_TYPE_0 = "GNU" + NN_LOONGARCH_CPUCFG = "LINUX" + NN_LOONGARCH_CSR = "LINUX" + NN_LOONGARCH_HW_BREAK = "LINUX" + NN_LOONGARCH_HW_WATCH = "LINUX" + NN_LOONGARCH_LASX = "LINUX" + NN_LOONGARCH_LBT = "LINUX" + NN_LOONGARCH_LSX = "LINUX" + NN_MIPS_DSP = "LINUX" + NN_MIPS_FP_MODE = "LINUX" + NN_MIPS_MSA = "LINUX" + NN_PPC_DEXCR = "LINUX" + NN_PPC_DSCR = "LINUX" + NN_PPC_EBB = "LINUX" + NN_PPC_HASHKEYR = "LINUX" + NN_PPC_PKEY = "LINUX" + NN_PPC_PMU = "LINUX" + NN_PPC_PPR = "LINUX" + NN_PPC_SPE = "LINUX" + NN_PPC_TAR = "LINUX" + NN_PPC_TM_CDSCR = "LINUX" + NN_PPC_TM_CFPR = "LINUX" + NN_PPC_TM_CGPR = "LINUX" + NN_PPC_TM_CPPR = "LINUX" + NN_PPC_TM_CTAR = "LINUX" + NN_PPC_TM_CVMX = "LINUX" + NN_PPC_TM_CVSX = "LINUX" + NN_PPC_TM_SPR = "LINUX" + NN_PPC_VMX = "LINUX" + NN_PPC_VSX = "LINUX" + NN_PRFPREG = "CORE" + NN_PRPSINFO = "CORE" + NN_PRSTATUS = "CORE" + NN_PRXFPREG = "LINUX" + NN_RISCV_CSR = "LINUX" + NN_RISCV_TAGGED_ADDR_CTRL = "LINUX" + NN_RISCV_VECTOR = "LINUX" + NN_S390_CTRS = "LINUX" + NN_S390_GS_BC = "LINUX" + NN_S390_GS_CB = "LINUX" + NN_S390_HIGH_GPRS = "LINUX" + NN_S390_LAST_BREAK = "LINUX" + NN_S390_PREFIX = "LINUX" + NN_S390_PV_CPU_DATA = "LINUX" + NN_S390_RI_CB = "LINUX" + NN_S390_SYSTEM_CALL = "LINUX" + NN_S390_TDB = "LINUX" + NN_S390_TIMER = "LINUX" + NN_S390_TODCMP = "LINUX" + NN_S390_TODPREG = "LINUX" + NN_S390_VXRS_HIGH = "LINUX" + NN_S390_VXRS_LOW = "LINUX" + NN_SIGINFO = "CORE" + NN_TASKSTRUCT = "CORE" + NN_VMCOREDD = "LINUX" + NN_X86_SHSTK = "LINUX" + NN_X86_XSAVE_LAYOUT = "LINUX" + NN_X86_XSTATE = "LINUX" NSFS_MAGIC = 0x6e736673 + NT_386_IOPERM = 0x201 + NT_386_TLS = 0x200 + NT_ARC_V2 = 0x600 + NT_ARM_FPMR = 0x40e + NT_ARM_GCS = 0x410 + NT_ARM_HW_BREAK = 0x402 + NT_ARM_HW_WATCH = 0x403 + NT_ARM_PACA_KEYS = 0x407 + NT_ARM_PACG_KEYS = 0x408 + NT_ARM_PAC_ENABLED_KEYS = 0x40a + NT_ARM_PAC_MASK = 0x406 + NT_ARM_POE = 0x40f + NT_ARM_SSVE = 0x40b + NT_ARM_SVE = 0x405 + NT_ARM_SYSTEM_CALL = 0x404 + NT_ARM_TAGGED_ADDR_CTRL = 0x409 + NT_ARM_TLS = 0x401 + NT_ARM_VFP = 0x400 + NT_ARM_ZA = 0x40c + NT_ARM_ZT = 0x40d + NT_AUXV = 0x6 + NT_FILE = 0x46494c45 + NT_GNU_PROPERTY_TYPE_0 = 0x5 + NT_LOONGARCH_CPUCFG = 0xa00 + NT_LOONGARCH_CSR = 0xa01 + NT_LOONGARCH_HW_BREAK = 0xa05 + NT_LOONGARCH_HW_WATCH = 0xa06 + NT_LOONGARCH_LASX = 0xa03 + NT_LOONGARCH_LBT = 0xa04 + NT_LOONGARCH_LSX = 0xa02 + NT_MIPS_DSP = 0x800 + NT_MIPS_FP_MODE = 0x801 + NT_MIPS_MSA = 0x802 + NT_PPC_DEXCR = 0x111 + NT_PPC_DSCR = 0x105 + NT_PPC_EBB = 0x106 + NT_PPC_HASHKEYR = 0x112 + NT_PPC_PKEY = 0x110 + NT_PPC_PMU = 0x107 + NT_PPC_PPR = 0x104 + NT_PPC_SPE = 0x101 + NT_PPC_TAR = 0x103 + NT_PPC_TM_CDSCR = 0x10f + NT_PPC_TM_CFPR = 0x109 + NT_PPC_TM_CGPR = 0x108 + NT_PPC_TM_CPPR = 0x10e + NT_PPC_TM_CTAR = 0x10d + NT_PPC_TM_CVMX = 0x10a + NT_PPC_TM_CVSX = 0x10b + NT_PPC_TM_SPR = 0x10c + NT_PPC_VMX = 0x100 + NT_PPC_VSX = 0x102 + NT_PRFPREG = 0x2 + NT_PRPSINFO = 0x3 + NT_PRSTATUS = 0x1 + NT_PRXFPREG = 0x46e62b7f + NT_RISCV_CSR = 0x900 + NT_RISCV_TAGGED_ADDR_CTRL = 0x902 + NT_RISCV_VECTOR = 0x901 + NT_S390_CTRS = 0x304 + NT_S390_GS_BC = 0x30c + NT_S390_GS_CB = 0x30b + NT_S390_HIGH_GPRS = 0x300 + NT_S390_LAST_BREAK = 0x306 + NT_S390_PREFIX = 0x305 + NT_S390_PV_CPU_DATA = 0x30e + NT_S390_RI_CB = 0x30d + NT_S390_SYSTEM_CALL = 0x307 + NT_S390_TDB = 0x308 + NT_S390_TIMER = 0x301 + NT_S390_TODCMP = 0x302 + NT_S390_TODPREG = 0x303 + NT_S390_VXRS_HIGH = 0x30a + NT_S390_VXRS_LOW = 0x309 + NT_SIGINFO = 0x53494749 + NT_TASKSTRUCT = 0x4 + NT_VMCOREDD = 0x700 + NT_X86_SHSTK = 0x204 + NT_X86_XSAVE_LAYOUT = 0x205 + NT_X86_XSTATE = 0x202 OCFS2_SUPER_MAGIC = 0x7461636f OCRNL = 0x8 OFDEL = 0x80 @@ -2463,6 +2699,59 @@ const ( PERF_RECORD_MISC_USER = 0x2 PERF_SAMPLE_BRANCH_PLM_ALL = 0x7 PERF_SAMPLE_WEIGHT_TYPE = 0x1004000 + PF_ALG = 0x26 + PF_APPLETALK = 0x5 + PF_ASH = 0x12 + PF_ATMPVC = 0x8 + PF_ATMSVC = 0x14 + PF_AX25 = 0x3 + PF_BLUETOOTH = 0x1f + PF_BRIDGE = 0x7 + PF_CAIF = 0x25 + PF_CAN = 0x1d + PF_DECnet = 0xc + PF_ECONET = 0x13 + PF_FILE = 0x1 + PF_IB = 0x1b + PF_IEEE802154 = 0x24 + PF_INET = 0x2 + PF_INET6 = 0xa + PF_IPX = 0x4 + PF_IRDA = 0x17 + PF_ISDN = 0x22 + PF_IUCV = 0x20 + PF_KCM = 0x29 + PF_KEY = 0xf + PF_LLC = 0x1a + PF_LOCAL = 0x1 + PF_MAX = 0x2e + PF_MCTP = 0x2d + PF_MPLS = 0x1c + PF_NETBEUI = 0xd + PF_NETLINK = 0x10 + PF_NETROM = 0x6 + PF_NFC = 0x27 + PF_PACKET = 0x11 + PF_PHONET = 0x23 + PF_PPPOX = 0x18 + PF_QIPCRTR = 0x2a + PF_R = 0x4 + PF_RDS = 0x15 + PF_ROSE = 0xb + PF_ROUTE = 0x10 + PF_RXRPC = 0x21 + PF_SECURITY = 0xe + PF_SMC = 0x2b + PF_SNA = 0x16 + PF_TIPC = 0x1e + PF_UNIX = 0x1 + PF_UNSPEC = 0x0 + PF_VSOCK = 0x28 + PF_W = 0x2 + PF_WANPIPE = 0x19 + PF_X = 0x1 + PF_X25 = 0x9 + PF_XDP = 0x2c PID_FS_MAGIC = 0x50494446 PIPEFS_MAGIC = 0x50495045 PPPIOCGNPMODE = 0xc008744c @@ -2758,6 +3047,23 @@ const ( PTRACE_SYSCALL_INFO_NONE = 0x0 PTRACE_SYSCALL_INFO_SECCOMP = 0x3 PTRACE_TRACEME = 0x0 + PT_AARCH64_MEMTAG_MTE = 0x70000002 + PT_DYNAMIC = 0x2 + PT_GNU_EH_FRAME = 0x6474e550 + PT_GNU_PROPERTY = 0x6474e553 + PT_GNU_RELRO = 0x6474e552 + PT_GNU_STACK = 0x6474e551 + PT_HIOS = 0x6fffffff + PT_HIPROC = 0x7fffffff + PT_INTERP = 0x3 + PT_LOAD = 0x1 + PT_LOOS = 0x60000000 + PT_LOPROC = 0x70000000 + PT_NOTE = 0x4 + PT_NULL = 0x0 + PT_PHDR = 0x6 + PT_SHLIB = 0x5 + PT_TLS = 0x7 P_ALL = 0x0 P_PGID = 0x2 P_PID = 0x1 @@ -3091,6 +3397,47 @@ const ( SEEK_MAX = 0x4 SEEK_SET = 0x0 SELINUX_MAGIC = 0xf97cff8c + SHF_ALLOC = 0x2 + SHF_EXCLUDE = 0x8000000 + SHF_EXECINSTR = 0x4 + SHF_GROUP = 0x200 + SHF_INFO_LINK = 0x40 + SHF_LINK_ORDER = 0x80 + SHF_MASKOS = 0xff00000 + SHF_MASKPROC = 0xf0000000 + SHF_MERGE = 0x10 + SHF_ORDERED = 0x4000000 + SHF_OS_NONCONFORMING = 0x100 + SHF_RELA_LIVEPATCH = 0x100000 + SHF_RO_AFTER_INIT = 0x200000 + SHF_STRINGS = 0x20 + SHF_TLS = 0x400 + SHF_WRITE = 0x1 + SHN_ABS = 0xfff1 + SHN_COMMON = 0xfff2 + SHN_HIPROC = 0xff1f + SHN_HIRESERVE = 0xffff + SHN_LIVEPATCH = 0xff20 + SHN_LOPROC = 0xff00 + SHN_LORESERVE = 0xff00 + SHN_UNDEF = 0x0 + SHT_DYNAMIC = 0x6 + SHT_DYNSYM = 0xb + SHT_HASH = 0x5 + SHT_HIPROC = 0x7fffffff + SHT_HIUSER = 0xffffffff + SHT_LOPROC = 0x70000000 + SHT_LOUSER = 0x80000000 + SHT_NOBITS = 0x8 + SHT_NOTE = 0x7 + SHT_NULL = 0x0 + SHT_NUM = 0xc + SHT_PROGBITS = 0x1 + SHT_REL = 0x9 + SHT_RELA = 0x4 + SHT_SHLIB = 0xa + SHT_STRTAB = 0x3 + SHT_SYMTAB = 0x2 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 @@ -3317,6 +3664,16 @@ const ( STATX_UID = 0x8 STATX_WRITE_ATOMIC = 0x10000 STATX__RESERVED = 0x80000000 + STB_GLOBAL = 0x1 + STB_LOCAL = 0x0 + STB_WEAK = 0x2 + STT_COMMON = 0x5 + STT_FILE = 0x4 + STT_FUNC = 0x2 + STT_NOTYPE = 0x0 + STT_OBJECT = 0x1 + STT_SECTION = 0x3 + STT_TLS = 0x6 SYNC_FILE_RANGE_WAIT_AFTER = 0x4 SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 SYNC_FILE_RANGE_WRITE = 0x2 @@ -3553,6 +3910,8 @@ const ( UTIME_OMIT = 0x3ffffffe V9FS_MAGIC = 0x1021997 VERASE = 0x2 + VER_FLG_BASE = 0x1 + VER_FLG_WEAK = 0x2 VINTR = 0x0 VKILL = 0x3 VLNEXT = 0xf diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 5cc1e8eb2..8935d10a3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -2238,3 +2238,13 @@ func Mseal(b []byte, flags uint) (err error) { } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setMemPolicy(mode int, mask *CPUSet, size int) (err error) { + _, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(unsafe.Pointer(mask)), uintptr(size)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 944e75a11..c1a467017 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -3590,6 +3590,8 @@ type Nhmsg struct { Flags uint32 } +const SizeofNhmsg = 0x8 + type NexthopGrp struct { Id uint32 Weight uint8 @@ -3597,6 +3599,8 @@ type NexthopGrp struct { Resvd2 uint16 } +const SizeofNexthopGrp = 0x8 + const ( NHA_UNSPEC = 0x0 NHA_ID = 0x1 @@ -6332,3 +6336,30 @@ type SockDiagReq struct { } const RTM_NEWNVLAN = 0x70 + +const ( + MPOL_BIND = 0x2 + MPOL_DEFAULT = 0x0 + MPOL_F_ADDR = 0x2 + MPOL_F_MEMS_ALLOWED = 0x4 + MPOL_F_MOF = 0x8 + MPOL_F_MORON = 0x10 + MPOL_F_NODE = 0x1 + MPOL_F_NUMA_BALANCING = 0x2000 + MPOL_F_RELATIVE_NODES = 0x4000 + MPOL_F_SHARED = 0x1 + MPOL_F_STATIC_NODES = 0x8000 + MPOL_INTERLEAVE = 0x3 + MPOL_LOCAL = 0x4 + MPOL_MAX = 0x7 + MPOL_MF_INTERNAL = 0x10 + MPOL_MF_LAZY = 0x8 + MPOL_MF_MOVE_ALL = 0x4 + MPOL_MF_MOVE = 0x2 + MPOL_MF_STRICT = 0x1 + MPOL_MF_VALID = 0x7 + MPOL_MODE_FLAGS = 0xe000 + MPOL_PREFERRED = 0x1 + MPOL_PREFERRED_MANY = 0x5 + MPOL_WEIGHTED_INTERLEAVE = 0x6 +) diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index bd5133730..69439df2a 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -892,8 +892,12 @@ const socket_error = uintptr(^uint32(0)) //sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar //sys getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) = iphlpapi.GetBestInterfaceEx //sys GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) = iphlpapi.GetIfEntry2Ex +//sys GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) = iphlpapi.GetIpForwardEntry2 +//sys GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) = iphlpapi.GetIpForwardTable2 //sys GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) = iphlpapi.GetUnicastIpAddressEntry +//sys FreeMibTable(memory unsafe.Pointer) = iphlpapi.FreeMibTable //sys NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyIpInterfaceChange +//sys NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyRouteChange2 //sys NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyUnicastIpAddressChange //sys CancelMibChangeNotify2(notificationHandle Handle) (errcode error) = iphlpapi.CancelMibChangeNotify2 @@ -916,6 +920,17 @@ type RawSockaddrInet6 struct { Scope_id uint32 } +// RawSockaddrInet is a union that contains an IPv4, an IPv6 address, or an address family. See +// https://learn.microsoft.com/en-us/windows/win32/api/ws2ipdef/ns-ws2ipdef-sockaddr_inet. +// +// A [*RawSockaddrInet] may be converted to a [*RawSockaddrInet4] or [*RawSockaddrInet6] using +// unsafe, depending on the address family. +type RawSockaddrInet struct { + Family uint16 + Port uint16 + Data [6]uint32 +} + type RawSockaddr struct { Family uint16 Data [14]int8 diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 358be3c7f..6e4f50eb4 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -2320,6 +2320,82 @@ type MibIfRow2 struct { OutQLen uint64 } +// IP_ADDRESS_PREFIX stores an IP address prefix. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-ip_address_prefix. +type IpAddressPrefix struct { + Prefix RawSockaddrInet + PrefixLength uint8 +} + +// NL_ROUTE_ORIGIN enumeration from nldef.h or +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_route_origin. +const ( + NlroManual = 0 + NlroWellKnown = 1 + NlroDHCP = 2 + NlroRouterAdvertisement = 3 + Nlro6to4 = 4 +) + +// NL_ROUTE_ORIGIN enumeration from nldef.h or +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_route_protocol. +const ( + MIB_IPPROTO_OTHER = 1 + MIB_IPPROTO_LOCAL = 2 + MIB_IPPROTO_NETMGMT = 3 + MIB_IPPROTO_ICMP = 4 + MIB_IPPROTO_EGP = 5 + MIB_IPPROTO_GGP = 6 + MIB_IPPROTO_HELLO = 7 + MIB_IPPROTO_RIP = 8 + MIB_IPPROTO_IS_IS = 9 + MIB_IPPROTO_ES_IS = 10 + MIB_IPPROTO_CISCO = 11 + MIB_IPPROTO_BBN = 12 + MIB_IPPROTO_OSPF = 13 + MIB_IPPROTO_BGP = 14 + MIB_IPPROTO_IDPR = 15 + MIB_IPPROTO_EIGRP = 16 + MIB_IPPROTO_DVMRP = 17 + MIB_IPPROTO_RPL = 18 + MIB_IPPROTO_DHCP = 19 + MIB_IPPROTO_NT_AUTOSTATIC = 10002 + MIB_IPPROTO_NT_STATIC = 10006 + MIB_IPPROTO_NT_STATIC_NON_DOD = 10007 +) + +// MIB_IPFORWARD_ROW2 stores information about an IP route entry. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_row2. +type MibIpForwardRow2 struct { + InterfaceLuid uint64 + InterfaceIndex uint32 + DestinationPrefix IpAddressPrefix + NextHop RawSockaddrInet + SitePrefixLength uint8 + ValidLifetime uint32 + PreferredLifetime uint32 + Metric uint32 + Protocol uint32 + Loopback uint8 + AutoconfigureAddress uint8 + Publish uint8 + Immortal uint8 + Age uint32 + Origin uint32 +} + +// MIB_IPFORWARD_TABLE2 contains a table of IP route entries. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_table2. +type MibIpForwardTable2 struct { + NumEntries uint32 + Table [1]MibIpForwardRow2 +} + +// Rows returns the IP route entries in the table. +func (t *MibIpForwardTable2) Rows() []MibIpForwardRow2 { + return unsafe.Slice(&t.Table[0], t.NumEntries) +} + // MIB_UNICASTIPADDRESS_ROW stores information about a unicast IP address. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_unicastipaddress_row. type MibUnicastIpAddressRow struct { diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 426151a01..f25b7308a 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -182,13 +182,17 @@ var ( procDwmGetWindowAttribute = moddwmapi.NewProc("DwmGetWindowAttribute") procDwmSetWindowAttribute = moddwmapi.NewProc("DwmSetWindowAttribute") procCancelMibChangeNotify2 = modiphlpapi.NewProc("CancelMibChangeNotify2") + procFreeMibTable = modiphlpapi.NewProc("FreeMibTable") procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses") procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo") procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx") procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex") + procGetIpForwardEntry2 = modiphlpapi.NewProc("GetIpForwardEntry2") + procGetIpForwardTable2 = modiphlpapi.NewProc("GetIpForwardTable2") procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry") procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange") + procNotifyRouteChange2 = modiphlpapi.NewProc("NotifyRouteChange2") procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange") procAddDllDirectory = modkernel32.NewProc("AddDllDirectory") procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") @@ -1624,6 +1628,11 @@ func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) { return } +func FreeMibTable(memory unsafe.Pointer) { + syscall.SyscallN(procFreeMibTable.Addr(), uintptr(memory)) + return +} + func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { r0, _, _ := syscall.SyscallN(procGetAdaptersAddresses.Addr(), uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer))) if r0 != 0 { @@ -1664,6 +1673,22 @@ func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { return } +func GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIpForwardEntry2.Addr(), uintptr(unsafe.Pointer(row))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + +func GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIpForwardTable2.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { @@ -1684,6 +1709,18 @@ func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsa return } +func NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { + var _p0 uint32 + if initialNotification { + _p0 = 1 + } + r0, _, _ := syscall.SyscallN(procNotifyRouteChange2.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { var _p0 uint32 if initialNotification { diff --git a/vendor/modules.txt b/vendor/modules.txt index 224e7e122..71e6a22ba 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -160,8 +160,8 @@ github.com/josharian/intern # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/klauspost/compress v1.18.0 -## explicit; go 1.22 +# github.com/klauspost/compress v1.18.1 +## explicit; go 1.23 github.com/klauspost/compress github.com/klauspost/compress/fse github.com/klauspost/compress/huff0 @@ -309,7 +309,7 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/regclient/regclient v0.9.2 +# github.com/regclient/regclient v0.10.0 ## explicit; go 1.24.0 github.com/regclient/regclient github.com/regclient/regclient/config @@ -363,7 +363,7 @@ github.com/spf13/cast # github.com/spf13/cobra v1.10.1 ## explicit; go 1.15 github.com/spf13/cobra -# github.com/spf13/pflag v1.0.9 +# github.com/spf13/pflag v1.0.10 ## explicit; go 1.12 github.com/spf13/pflag # github.com/stretchr/testify v1.11.1 @@ -441,7 +441,7 @@ golang.org/x/oauth2/internal # golang.org/x/sync v0.17.0 ## explicit; go 1.24.0 golang.org/x/sync/errgroup -# golang.org/x/sys v0.37.0 +# golang.org/x/sys v0.38.0 ## explicit; go 1.24.0 golang.org/x/sys/plan9 golang.org/x/sys/unix