diff --git a/go.mod b/go.mod
index 8543158aeb..c1db87a181 100644
--- a/go.mod
+++ b/go.mod
@@ -21,7 +21,7 @@ require (
github.com/google/addlicense v1.2.0
github.com/google/gnostic-models v0.7.1
github.com/google/go-cmp v0.7.0
- github.com/google/go-containerregistry v0.21.2
+ github.com/google/go-containerregistry v0.21.3
github.com/google/go-licenses/v2 v2.0.1
github.com/google/uuid v1.6.0
github.com/jstemmer/go-junit-report/v2 v2.1.0
@@ -85,7 +85,7 @@ require (
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.18.2 // indirect
github.com/distribution/reference v0.6.0 // indirect
- github.com/docker/cli v29.2.1+incompatible // indirect
+ github.com/docker/cli v29.3.0+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.3 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
@@ -140,9 +140,9 @@ require (
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
- github.com/sirupsen/logrus v1.9.3 // indirect
+ github.com/sirupsen/logrus v1.9.4 // indirect
github.com/spf13/afero v1.12.0 // indirect
- github.com/spf13/pflag v1.0.9 // indirect
+ github.com/spf13/pflag v1.0.10 // indirect
github.com/vbatts/tar-split v0.12.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
@@ -155,15 +155,15 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
- golang.org/x/crypto v0.48.0 // indirect
- golang.org/x/net v0.51.0 // indirect
+ golang.org/x/crypto v0.49.0 // indirect
+ golang.org/x/net v0.52.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.20.0 // indirect
- golang.org/x/sys v0.41.0 // indirect
- golang.org/x/term v0.40.0 // indirect
- golang.org/x/text v0.34.0 // indirect
+ golang.org/x/sys v0.42.0 // indirect
+ golang.org/x/term v0.41.0 // indirect
+ golang.org/x/text v0.35.0 // indirect
golang.org/x/time v0.15.0 // indirect
- golang.org/x/tools v0.42.0 // indirect
+ golang.org/x/tools v0.43.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect
@@ -173,6 +173,7 @@ require (
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
+ gotest.tools/v3 v3.5.2 // indirect
k8s.io/component-base v0.35.2 // indirect
k8s.io/component-helpers v0.35.2 // indirect
k8s.io/controller-manager v0.35.0 // indirect
diff --git a/go.sum b/go.sum
index 5282ec4a02..0d3f9a4c12 100644
--- a/go.sum
+++ b/go.sum
@@ -72,8 +72,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
-github.com/docker/cli v29.2.1+incompatible h1:n3Jt0QVCN65eiVBoUTZQM9mcQICCJt3akW4pKAbKdJg=
-github.com/docker/cli v29.2.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
+github.com/docker/cli v29.3.0+incompatible h1:z3iWveU7h19Pqx7alZES8j+IeFQZ1lhTwb2F+V9SVvk=
+github.com/docker/cli v29.3.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8=
@@ -164,8 +164,8 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
-github.com/google/go-containerregistry v0.21.2 h1:vYaMU4nU55JJGFC9JR/s8NZcTjbE9DBBbvusTW9NeS0=
-github.com/google/go-containerregistry v0.21.2/go.mod h1:ctO5aCaewH4AK1AumSF5DPW+0+R+d2FmylMJdp5G7p0=
+github.com/google/go-containerregistry v0.21.3 h1:Xr+yt3VvwOOn/5nJzd7UoOhwPGiPkYW0zWDLLUXqAi4=
+github.com/google/go-containerregistry v0.21.3/go.mod h1:D5ZrJF1e6dMzvInpBPuMCX0FxURz7GLq2rV3Us9aPkc=
github.com/google/go-licenses/v2 v2.0.1 h1:ti+9bi5o7DKbeeg5eBb/uZTgsaPNoJaLCh93cRcXsW8=
github.com/google/go-licenses/v2 v2.0.1/go.mod h1:efibo0EDNGkau6AIMOViGW+rTNPudhxX9rCxtfw5zKE=
github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk=
@@ -295,14 +295,15 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
-github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
-github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
+github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs=
github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4=
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
-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/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo=
github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs=
github.com/spyzhov/ajson v0.9.6 h1:iJRDaLa+GjhCDAt1yFtU/LKMtLtsNVKkxqlpvrHHlpQ=
@@ -365,8 +366,8 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
-golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
+golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
+golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
@@ -381,8 +382,8 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=
-golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
+golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
+golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q=
@@ -397,17 +398,16 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
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.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
-golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
-golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg=
-golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM=
+golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
+golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
+golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU=
+golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
-golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
+golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
+golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -415,8 +415,8 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
-golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
+golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=
+golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=
golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM=
golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM=
@@ -474,8 +474,8 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
-gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
+gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
+gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.35.2 h1:tW7mWc2RpxW7HS4CoRXhtYHSzme1PN1UjGHJ1bdrtdw=
diff --git a/vendor/github.com/docker/cli/cli/config/configfile/file.go b/vendor/github.com/docker/cli/cli/config/configfile/file.go
index fab3ed4cba..246f23e983 100644
--- a/vendor/github.com/docker/cli/cli/config/configfile/file.go
+++ b/vendor/github.com/docker/cli/cli/config/configfile/file.go
@@ -1,3 +1,6 @@
+// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
+//go:build go1.24
+
package configfile
import (
@@ -6,6 +9,7 @@ import (
"errors"
"fmt"
"io"
+ "maps"
"os"
"path/filepath"
"strings"
@@ -374,9 +378,7 @@ func getConfiguredCredentialStore(c *ConfigFile, registryHostname string) string
func (configFile *ConfigFile) GetAllCredentials() (map[string]types.AuthConfig, error) {
auths := make(map[string]types.AuthConfig)
addAll := func(from map[string]types.AuthConfig) {
- for reg, ac := range from {
- auths[reg] = ac
- }
+ maps.Copy(auths, from)
}
defaultStore := configFile.GetCredentialsStore("")
diff --git a/vendor/github.com/google/go-containerregistry/cmd/crane/cmd/index.go b/vendor/github.com/google/go-containerregistry/cmd/crane/cmd/index.go
index 64e0984091..7071037ee2 100644
--- a/vendor/github.com/google/go-containerregistry/cmd/crane/cmd/index.go
+++ b/vendor/github.com/google/go-containerregistry/cmd/crane/cmd/index.go
@@ -17,12 +17,15 @@ package cmd
import (
"errors"
"fmt"
+ "os"
+ "strings"
"github.com/google/go-containerregistry/pkg/crane"
"github.com/google/go-containerregistry/pkg/logs"
"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/empty"
+ "github.com/google/go-containerregistry/pkg/v1/layout"
"github.com/google/go-containerregistry/pkg/v1/match"
"github.com/google/go-containerregistry/pkg/v1/mutate"
"github.com/google/go-containerregistry/pkg/v1/partial"
@@ -41,10 +44,69 @@ func NewCmdIndex(options *[]crane.Option) *cobra.Command {
cmd.Usage()
},
}
- cmd.AddCommand(NewCmdIndexFilter(options), NewCmdIndexAppend(options))
+ cmd.AddCommand(NewCmdIndexFilter(options), NewCmdIndexAppend(options), NewCmdIndexList(options))
return cmd
}
+// NewCmdIndexList creates a new cobra.Command for the index list subcommand.
+func NewCmdIndexList(options *[]crane.Option) *cobra.Command {
+ return &cobra.Command{
+ Use: "list",
+ Short: "List the manifests in an index.",
+ Args: cobra.ExactArgs(1),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ baseRef := args[0]
+ o := crane.GetOptions(*options...)
+
+ isLocal := isLocalReference(baseRef)
+
+ var idx v1.ImageIndex
+ if isLocal {
+ p, err := layout.FromPath(baseRef)
+ if err != nil {
+ return err
+ }
+ idx, err = p.ImageIndex()
+ if err != nil {
+ return err
+ }
+ } else {
+ ref, err := name.ParseReference(baseRef, o.Name...)
+ if err != nil {
+ return err
+ }
+ desc, err := remote.Get(ref, o.Remote...)
+ if err != nil {
+ return fmt.Errorf("pulling %s: %w", baseRef, err)
+ }
+ if !desc.MediaType.IsIndex() {
+ return fmt.Errorf("expected %s to be an index, got %q", baseRef, desc.MediaType)
+ }
+ idx, err = desc.ImageIndex()
+ if err != nil {
+ return err
+ }
+ }
+
+ m, err := idx.IndexManifest()
+ if err != nil {
+ return err
+ }
+
+ // Print header
+ fmt.Fprintf(cmd.OutOrStdout(), "%-70s %-20s %s\n", "Digest", "MediaType", "Platform")
+ for _, manifest := range m.Manifests {
+ platform := "-"
+ if manifest.Platform != nil {
+ platform = manifest.Platform.String()
+ }
+ fmt.Fprintf(cmd.OutOrStdout(), "%-70s %-20s %s\n", manifest.Digest, manifest.MediaType, platform)
+ }
+ return nil
+ },
+ }
+}
+
// NewCmdIndexFilter creates a new cobra.Command for the index filter subcommand.
func NewCmdIndexFilter(options *[]crane.Option) *cobra.Command {
var newTag string
@@ -79,6 +141,7 @@ func NewCmdIndexFilter(options *[]crane.Option) *cobra.Command {
}
base, err := desc.ImageIndex()
if err != nil {
+ // If we can't get the image index, we just return nil to silently stop.
return nil
}
@@ -132,151 +195,142 @@ The platform for appended manifests is inferred from the config file or omitted
# Create an index from scratch for etcd.
crane index append -m registry.k8s.io/etcd-amd64:3.4.9 -m registry.k8s.io/etcd-arm64:3.4.9 -t example.com/etcd`,
- Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
- if len(args) == 1 {
+ if len(args) > 0 {
baseRef = args[0]
+ newManifests = append(newManifests, args[1:]...)
}
o := crane.GetOptions(*options...)
- var (
- base v1.ImageIndex
- err error
- ref name.Reference
- )
-
- if baseRef == "" {
- if newTag == "" {
- return errors.New("at least one of --base or --tag must be specified")
- }
+ adds, err := collectAddendums(newManifests, o, flatten)
+ if err != nil {
+ return err
+ }
- logs.Warn.Printf("base unspecified, using empty index")
- base = empty.Index
- if dockerEmptyBase {
- base = mutate.IndexMediaType(base, types.DockerManifestList)
- }
- } else {
- ref, err = name.ParseReference(baseRef, o.Name...)
- if err != nil {
- return err
- }
- desc, err := remote.Get(ref, o.Remote...)
- if err != nil {
- return fmt.Errorf("pulling %s: %w", baseRef, err)
- }
- if !desc.MediaType.IsIndex() {
- return fmt.Errorf("expected %s to be an index, got %q", baseRef, desc.MediaType)
- }
- base, err = desc.ImageIndex()
- if err != nil {
- return err
- }
+ if isLocalReference(baseRef) {
+ return appendLocal(baseRef, adds)
}
+ return appendRemote(cmd, baseRef, newTag, adds, o, dockerEmptyBase)
+ },
+ }
+ cmd.Flags().StringVarP(&newTag, "tag", "t", "", "Tag to apply to resulting image")
+ cmd.Flags().StringSliceVarP(&newManifests, "manifest", "m", []string{}, "References to manifests to append to the base index")
+ cmd.Flags().BoolVar(&dockerEmptyBase, "docker-empty-base", false, "If true, empty base index will have Docker media types instead of OCI")
+ cmd.Flags().BoolVar(&flatten, "flatten", true, "If true, appending an index will append each of its children rather than the index itself")
- adds := make([]mutate.IndexAddendum, 0, len(newManifests))
+ return cmd
+}
- for _, m := range newManifests {
- ref, err := name.ParseReference(m, o.Name...)
- if err != nil {
- return err
- }
- desc, err := remote.Get(ref, o.Remote...)
- if err != nil {
- return err
- }
- if desc.MediaType.IsImage() {
- img, err := desc.Image()
- if err != nil {
- return err
- }
+func appendLocal(baseRef string, adds []mutate.IndexAddendum) error {
+ var p layout.Path
+ if _, err := os.Stat(baseRef); err == nil {
+ // If the path exists, try to open it as an OCI layout.
+ var err error
+ p, err = layout.FromPath(baseRef)
+ if err != nil {
+ return err
+ }
+ } else {
+ // If the path does not exist, initialize a new OCI layout.
+ var err error
+ p, err = layout.Write(baseRef, empty.Index)
+ if err != nil {
+ return err
+ }
+ }
- cf, err := img.ConfigFile()
- if err != nil {
- return err
- }
- newDesc, err := partial.Descriptor(img)
- if err != nil {
- return err
- }
- newDesc.Platform = cf.Platform()
- adds = append(adds, mutate.IndexAddendum{
- Add: img,
- Descriptor: *newDesc,
- })
- } else if desc.MediaType.IsIndex() {
- idx, err := desc.ImageIndex()
- if err != nil {
- return err
- }
- if flatten {
- im, err := idx.IndexManifest()
- if err != nil {
- return err
- }
- for _, child := range im.Manifests {
- switch {
- case child.MediaType.IsImage():
- img, err := idx.Image(child.Digest)
- if err != nil {
- return err
- }
- adds = append(adds, mutate.IndexAddendum{
- Add: img,
- Descriptor: child,
- })
- case child.MediaType.IsIndex():
- idx, err := idx.ImageIndex(child.Digest)
- if err != nil {
- return err
- }
- adds = append(adds, mutate.IndexAddendum{
- Add: idx,
- Descriptor: child,
- })
- default:
- return fmt.Errorf("unexpected child %q with media type %q", child.Digest, child.MediaType)
- }
- }
- } else {
- adds = append(adds, mutate.IndexAddendum{
- Add: idx,
- })
- }
- } else {
- return fmt.Errorf("saw unexpected MediaType %q for %q", desc.MediaType, m)
- }
+ for _, add := range adds {
+ opts := []layout.Option{}
+ if add.Platform != nil {
+ opts = append(opts, layout.WithPlatform(*add.Platform))
+ }
+
+ if add.MediaType.IsImage() {
+ img, ok := add.Add.(v1.Image)
+ if !ok {
+ return fmt.Errorf("internal error: add.Add is not v1.Image: %T", add.Add)
+ }
+ if err := p.AppendImage(img, opts...); err != nil {
+ return err
+ }
+ } else if add.MediaType.IsIndex() {
+ idx, ok := add.Add.(v1.ImageIndex)
+ if !ok {
+ return fmt.Errorf("internal error: add.Add is not v1.ImageIndex: %T", add.Add)
}
+ if err := p.AppendIndex(idx, opts...); err != nil {
+ return err
+ }
+ } else {
+ return fmt.Errorf("unexpected media type for local append: %s", add.MediaType)
+ }
+ }
+ return nil
+}
- idx := mutate.AppendManifests(base, adds...)
- digest, err := idx.Digest()
+func appendRemote(cmd *cobra.Command, baseRef, newTag string, adds []mutate.IndexAddendum, o crane.Options, dockerEmptyBase bool) error {
+ var base v1.ImageIndex
+ if baseRef == "" {
+ if newTag == "" {
+ return errors.New("at least one of --base or --tag must be specified")
+ }
+ logs.Warn.Printf("base unspecified, using empty index")
+ base = empty.Index
+ if dockerEmptyBase {
+ base = mutate.IndexMediaType(base, types.DockerManifestList)
+ }
+ } else {
+ ref, err := name.ParseReference(baseRef, o.Name...)
+ if err != nil {
+ return err
+ }
+ desc, err := remote.Get(ref, o.Remote...)
+ if err != nil {
+ return fmt.Errorf("pulling %s: %w", baseRef, err)
+ }
+ if !desc.MediaType.IsIndex() {
+ return fmt.Errorf("expected %s to be an index, got %q", baseRef, desc.MediaType)
+ }
+ base, err = desc.ImageIndex()
+ if err != nil {
+ return err
+ }
+ }
+
+ idx := mutate.AppendManifests(base, adds...)
+ digest, err := idx.Digest()
+ if err != nil {
+ return err
+ }
+
+ var targetRef name.Reference
+ if newTag != "" {
+ targetRef, err = name.ParseReference(newTag, o.Name...)
+ if err != nil {
+ return fmt.Errorf("parsing reference %s: %w", newTag, err)
+ }
+ } else {
+ if baseRef != "" {
+ var err error
+ targetRef, err = name.ParseReference(baseRef, o.Name...)
if err != nil {
return err
}
-
- if newTag != "" {
- ref, err = name.ParseReference(newTag, o.Name...)
- if err != nil {
- return fmt.Errorf("parsing reference %s: %w", newTag, err)
- }
- } else {
- if _, ok := ref.(name.Digest); ok {
- ref = ref.Context().Digest(digest.String())
- }
+ if _, ok := targetRef.(name.Digest); ok {
+ targetRef = targetRef.Context().Digest(digest.String())
}
+ }
+ }
- if err := remote.WriteIndex(ref, idx, o.Remote...); err != nil {
- return fmt.Errorf("pushing image %s: %w", newTag, err)
- }
- fmt.Fprintln(cmd.OutOrStdout(), ref.Context().Digest(digest.String()))
- return nil
- },
+ if targetRef == nil {
+ return errors.New("no target reference determined")
}
- cmd.Flags().StringVarP(&newTag, "tag", "t", "", "Tag to apply to resulting image")
- cmd.Flags().StringSliceVarP(&newManifests, "manifest", "m", []string{}, "References to manifests to append to the base index")
- cmd.Flags().BoolVar(&dockerEmptyBase, "docker-empty-base", false, "If true, empty base index will have Docker media types instead of OCI")
- cmd.Flags().BoolVar(&flatten, "flatten", true, "If true, appending an index will append each of its children rather than the index itself")
- return cmd
+ if err := remote.WriteIndex(targetRef, idx, o.Remote...); err != nil {
+ return fmt.Errorf("pushing image %s: %w", targetRef, err)
+ }
+ fmt.Fprintln(cmd.OutOrStdout(), targetRef.Context().Digest(digest.String()))
+ return nil
}
func filterIndex(idx v1.ImageIndex, platforms []v1.Platform) v1.ImageIndex {
@@ -303,3 +357,142 @@ func not(in match.Matcher) match.Matcher {
return !in(desc)
}
}
+
+// resolveManifest resolves a reference to either a local OCI layout or a remote manifest.
+// It returns the manifest (Image or ImageIndex) and its descriptor.
+func resolveManifest(ref string, o crane.Options) (partial.WithRawManifest, v1.Descriptor, error) {
+ // Try loading as local image first. If this fails, we fall back to remote.
+ img, err := loadImage(ref, true)
+ if err == nil {
+ desc, err := partial.Descriptor(img.(partial.Describable))
+ if err != nil {
+ return nil, v1.Descriptor{}, err
+ }
+ // If it's an image, try to get platform from config.
+ // Platform info is not in the manifest, but is required for the index descriptor.
+ if desc.MediaType.IsImage() {
+ if i, ok := img.(v1.Image); ok {
+ cf, err := i.ConfigFile()
+ if err != nil {
+ return nil, v1.Descriptor{}, err
+ }
+ desc.Platform = cf.Platform()
+ }
+ }
+ return img, *desc, nil
+ }
+
+ // Fallback to remote
+ r, err := name.ParseReference(ref, o.Name...)
+ if err != nil {
+ return nil, v1.Descriptor{}, err
+ }
+ d, err := remote.Get(r, o.Remote...)
+ if err != nil {
+ return nil, v1.Descriptor{}, err
+ }
+
+ var remoteImg partial.WithRawManifest
+ if d.MediaType.IsImage() {
+ i, err := d.Image()
+ if err != nil {
+ return nil, v1.Descriptor{}, err
+ }
+ // Populate platform info from the config blob for the index descriptor.
+ cf, err := i.ConfigFile()
+ if err != nil {
+ return nil, v1.Descriptor{}, err
+ }
+ d.Platform = cf.Platform()
+ remoteImg = i
+ } else if d.MediaType.IsIndex() {
+ idx, err := d.ImageIndex()
+ if err != nil {
+ return nil, v1.Descriptor{}, err
+ }
+ remoteImg = idx
+ } else {
+ return nil, v1.Descriptor{}, fmt.Errorf("unknown media type: %s", d.MediaType)
+ }
+ return remoteImg, d.Descriptor, nil
+}
+
+// collectAddendums resolves a list of manifest references (local or remote) and
+// returns a slice of IndexAddendums that can be appended to an index.
+// If flatten is true, any referenced indices will have their individual child
+// manifests added to the result rather than the index itself.
+func collectAddendums(manifests []string, o crane.Options, flatten bool) ([]mutate.IndexAddendum, error) {
+ var adds []mutate.IndexAddendum
+ for _, m := range manifests {
+ img, desc, err := resolveManifest(m, o)
+ if err != nil {
+ return nil, err
+ }
+
+ if desc.MediaType.IsImage() {
+ i, ok := img.(v1.Image)
+ if !ok {
+ return nil, fmt.Errorf("expected v1.Image, got %T", img)
+ }
+ adds = append(adds, mutate.IndexAddendum{
+ Add: i,
+ Descriptor: desc,
+ })
+ } else if desc.MediaType.IsIndex() {
+ idx, ok := img.(v1.ImageIndex)
+ if !ok {
+ return nil, fmt.Errorf("expected v1.ImageIndex, got %T", img)
+ }
+ if flatten {
+ im, err := idx.IndexManifest()
+ if err != nil {
+ return nil, err
+ }
+ for _, child := range im.Manifests {
+ if child.MediaType.IsImage() {
+ childImg, err := idx.Image(child.Digest)
+ if err != nil {
+ return nil, err
+ }
+ adds = append(adds, mutate.IndexAddendum{
+ Add: childImg,
+ Descriptor: child,
+ })
+ } else if child.MediaType.IsIndex() {
+ childIdx, err := idx.ImageIndex(child.Digest)
+ if err != nil {
+ return nil, err
+ }
+ adds = append(adds, mutate.IndexAddendum{
+ Add: childIdx,
+ Descriptor: child,
+ })
+ } else {
+ return nil, fmt.Errorf("unexpected child media type: %s", child.MediaType)
+ }
+ }
+ } else {
+ adds = append(adds, mutate.IndexAddendum{
+ Add: idx,
+ Descriptor: desc,
+ })
+ }
+ } else {
+ return nil, fmt.Errorf("unexpected media type: %s", desc.MediaType)
+ }
+ }
+ return adds, nil
+}
+
+// isLocalReference checks if the reference is a local file path.
+// It returns true if the path exists on the filesystem.
+// If the path does NOT exist, it still returns true if it looks like a path
+// (starts with . or / or \ on Windows). This is necessary because
+// 'crane index append' can create new local OCI layout directories that
+// do not yet exist, and we need to distinguish these from remote references.
+func isLocalReference(ref string) bool {
+ if _, err := os.Stat(ref); err == nil {
+ return true
+ }
+ return strings.HasPrefix(ref, ".") || strings.HasPrefix(ref, "/") || strings.HasPrefix(ref, string(os.PathSeparator))
+}
diff --git a/vendor/github.com/google/go-containerregistry/cmd/crane/index_test.sh b/vendor/github.com/google/go-containerregistry/cmd/crane/index_test.sh
new file mode 100644
index 0000000000..8b38f3490c
--- /dev/null
+++ b/vendor/github.com/google/go-containerregistry/cmd/crane/index_test.sh
@@ -0,0 +1,196 @@
+#!/bin/bash
+set -e
+
+# Define paths
+CRANE_CMD="go run cmd/crane/main.go"
+TEST_DIR=$(mktemp -d)
+trap "rm -rf $TEST_DIR" EXIT
+
+echo "Using temp dir: $TEST_DIR"
+
+# Pull small images to use as base
+echo "Pulling base to tarball..."
+$CRANE_CMD pull gcr.io/distroless/base "$TEST_DIR/alpine.tar"
+echo "Pulling static to tarball..."
+$CRANE_CMD pull gcr.io/distroless/static "$TEST_DIR/busybox.tar"
+
+# Test 1: Append local tarballs to a new local index (directory)
+echo "Test 1: Append local tarballs to new local index (directory)..."
+$CRANE_CMD index append "$TEST_DIR/my-index" "$TEST_DIR/alpine.tar" "$TEST_DIR/busybox.tar"
+
+if [ -d "$TEST_DIR/my-index" ]; then
+ echo "PASS: Index directory created."
+else
+ echo "FAIL: Index directory not created."
+ exit 1
+fi
+
+# Verify content with list
+echo "Verifying content of my-index..."
+LIST_OUTPUT=$($CRANE_CMD index list "$TEST_DIR/my-index")
+echo "$LIST_OUTPUT"
+if echo "$LIST_OUTPUT" | grep -q "alpine"; then
+ # Note: list output shows digests, not names, unless we annotated them?
+ # Actually list output shows Digest, MediaType, Platform.
+ # We can check count.
+ true
+fi
+COUNT=$(echo "$LIST_OUTPUT" | grep -c "sha256:")
+if [ "$COUNT" -eq 2 ]; then
+ echo "PASS: Index contains 2 manifests."
+else
+ echo "FAIL: Index contains $COUNT manifests (expected 2)."
+ exit 1
+fi
+
+# Test 2: Append to a "tar file index" (directory named .tar)
+# This verifies we can create/write to a path ending in .tar, treating it as a layout directory.
+echo "Test 2: Append to 'tar file index' (directory named .tar)..."
+$CRANE_CMD index append "$TEST_DIR/output.tar" "$TEST_DIR/alpine.tar"
+
+if [ -d "$TEST_DIR/output.tar" ]; then
+ echo "PASS: Index directory (named .tar) created."
+else
+ echo "FAIL: Index directory (named .tar) not created."
+ exit 1
+fi
+
+# Verify content
+echo "Verifying content of output.tar..."
+LIST_OUTPUT=$($CRANE_CMD index list "$TEST_DIR/output.tar")
+echo "$LIST_OUTPUT"
+COUNT=$(echo "$LIST_OUTPUT" | grep -c "sha256:")
+if [ "$COUNT" -eq 1 ]; then
+ echo "PASS: Index contains 1 manifest."
+else
+ echo "FAIL: Index contains $COUNT manifests (expected 1)."
+ exit 1
+fi
+
+# Test 3: Append to existing index
+echo "Test 3: Append to existing index..."
+$CRANE_CMD index append "$TEST_DIR/output.tar" "$TEST_DIR/busybox.tar"
+LIST_OUTPUT=$($CRANE_CMD index list "$TEST_DIR/output.tar")
+COUNT=$(echo "$LIST_OUTPUT" | grep -c "sha256:")
+if [ "$COUNT" -eq 2 ]; then
+ echo "PASS: Index now contains 2 manifests."
+else
+ echo "FAIL: Index contains $COUNT manifests (expected 2)."
+ exit 1
+fi
+
+# Test 5: Negative test - Append to an existing file (not a layout directory)
+echo "Test 5: Negative test - Append to existing file..."
+# alpine.tar is a file (tarball), not an OCI layout directory
+set +e
+$CRANE_CMD index append "$TEST_DIR/alpine.tar" "$TEST_DIR/busybox.tar"
+EXIT_CODE=$?
+set -e
+
+if [ $EXIT_CODE -ne 0 ]; then
+ echo "PASS: Failed to append to a file (as expected)."
+else
+ echo "FAIL: Unexpectedly succeeded appending to a file."
+ exit 1
+fi
+
+
+
+# Test 6: Append remote image to local index
+echo "Test 6: Append remote image to local index..."
+# gcr.io/distroless/base is an index with several manifests.
+# flattened=true by default.
+$CRANE_CMD index append "$TEST_DIR/my-index-remote" "$TEST_DIR/busybox.tar" gcr.io/distroless/base
+LIST_OUTPUT=$($CRANE_CMD index list "$TEST_DIR/my-index-remote")
+COUNT=$(echo "$LIST_OUTPUT" | grep -c "sha256:")
+# 1 from busybox.tar + ~3-5 from distroless
+if [ "$COUNT" -ge 3 ]; then
+ echo "PASS: Index contains $COUNT manifests."
+else
+ echo "FAIL: Index contains $COUNT manifests (expected >= 3)."
+ exit 1
+fi
+
+if [ -z "$CRANE_TEST_REPO" ]; then
+ echo "Skipping remote tests. Set CRANE_TEST_REPO to run them."
+else
+ echo "Running remote tests against $CRANE_TEST_REPO..."
+ REPO="$CRANE_TEST_REPO"
+ TAG_1="$REPO:index-test-1"
+
+ # Remote Test 1: Create new remote index from local tarball
+ echo "Remote Test 1: Create new remote index $TAG_1 from local alpine.tar..."
+ # Note: We need --tag because we are creating from scratch (or implicit empty base)
+ $CRANE_CMD index append -m "$TEST_DIR/alpine.tar" -t "$TAG_1"
+
+ # Verify
+ LIST_OUTPUT=$($CRANE_CMD index list "$TAG_1")
+ COUNT=$(echo "$LIST_OUTPUT" | grep -c "sha256:")
+ if [ "$COUNT" -eq 1 ]; then
+ echo "PASS: Remote index created with 1 manifest."
+ else
+ echo "FAIL: Remote index contains $COUNT manifests (expected 1)."
+ exit 1
+ fi
+
+ # Remote Test 2: Append remote image to existing remote index
+ echo "Remote Test 2: Append distroless (remote) to $TAG_1..."
+ # We use TAG_1 as base, and update it in place (or we could use -t to same tag)
+ # Using positional arg as base
+ $CRANE_CMD index append "$TAG_1" -m "gcr.io/distroless/static:latest" -t "$TAG_1"
+
+ # Verify
+ LIST_OUTPUT=$($CRANE_CMD index list "$TAG_1")
+ COUNT=$(echo "$LIST_OUTPUT" | grep -c "sha256:")
+ if [ "$COUNT" -ge 4 ]; then
+ echo "PASS: Remote index now contains $COUNT manifests."
+ else
+ echo "FAIL: Remote index contains $COUNT manifests (expected >= 4)."
+ exit 1
+ fi
+
+ # Remote Test 3: Create index with Docker media types
+ echo "Remote Test 3: Create index with Docker media types..."
+ TAG_DOCKER="$REPO:index-docker"
+ $CRANE_CMD index append -m "$TEST_DIR/alpine.tar" -t "$TAG_DOCKER" --docker-empty-base
+ # Use crane manifest to verify the top-level media type.
+ MANIFEST=$($CRANE_CMD manifest "$TAG_DOCKER")
+ if echo "$MANIFEST" | grep -q "application/vnd.docker.distribution.manifest.list.v2+json"; then
+ echo "PASS: Index has Docker manifest list media type."
+ else
+ echo "FAIL: Index does not have Docker manifest list media type."
+ echo "$MANIFEST"
+ exit 1
+ fi
+fi
+
+# Test 7: Mixed sources and flattening control
+echo "Test 7: Mixed sources and flattening control..."
+# Append a local tarball AND a remote image to a new local index.
+# We also use --flatten=false to verify nested index support.
+$CRANE_CMD index append "$TEST_DIR/nested-index" \
+ -m "$TEST_DIR/busybox.tar" \
+ -m "gcr.io/distroless/base:latest" \
+ --flatten=false
+
+LIST_OUTPUT=$($CRANE_CMD index list "$TEST_DIR/nested-index")
+echo "$LIST_OUTPUT"
+# Should contain exactly 2 manifests: one image (from busybox.tar) and one index (distroless/base).
+COUNT=$(echo "$LIST_OUTPUT" | grep -c "sha256:")
+if [ "$COUNT" -eq 2 ]; then
+ echo "PASS: Nested index contains 2 manifests."
+else
+ echo "FAIL: Nested index contains $COUNT manifests (expected 2)."
+ exit 1
+fi
+
+# Verify platform metadata is present for the local image.
+# busybox.tar should have platform info (e.g. linux/amd64)
+if echo "$LIST_OUTPUT" | grep -q "linux/"; then
+ echo "PASS: Platform metadata found in list output."
+else
+ echo "FAIL: No platform metadata found in list output."
+ exit 1
+fi
+
+echo "All tests passed!"
diff --git a/vendor/github.com/google/go-containerregistry/pkg/v1/layout/layoutpath.go b/vendor/github.com/google/go-containerregistry/pkg/v1/layout/layoutpath.go
index a031ff5ae9..7014ca8c57 100644
--- a/vendor/github.com/google/go-containerregistry/pkg/v1/layout/layoutpath.go
+++ b/vendor/github.com/google/go-containerregistry/pkg/v1/layout/layoutpath.go
@@ -20,6 +20,6 @@ import "path/filepath"
type Path string
func (l Path) path(elem ...string) string {
- complete := []string{string(l)}
+ complete := []string{string(l)} //nolint:prealloc
return filepath.Join(append(complete, elem...)...)
}
diff --git a/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go b/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go
index bf1113c9fa..088572723e 100644
--- a/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go
+++ b/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go
@@ -296,6 +296,29 @@ func extract(img v1.Image, w io.Writer) error {
// Some tools prepend everything with "./", so if we don't Clean the
// name, we may have duplicate entries, which angers tar-split.
header.Name = filepath.Clean(header.Name)
+
+ // Normalize absolute paths to relative to prevent writing outside
+ // the extraction root (Zip Slip / CVE-2018-15664 class).
+ // Many OCI tools emit absolute paths; stripping the leading slash
+ // preserves the entry while removing the danger.
+ if filepath.IsAbs(header.Name) {
+ header.Name = strings.TrimLeft(header.Name, "/")
+ }
+ // After normalization, reject any remaining path traversal.
+ if strings.HasPrefix(header.Name, "..") {
+ continue
+ }
+
+ // Reject symlinks and hardlinks that point outside the extraction
+ // root. An attacker can create a symlink to /etc and then write
+ // files through it in a subsequent layer entry.
+ if header.Typeflag == tar.TypeSymlink || header.Typeflag == tar.TypeLink {
+ linkTarget := filepath.Clean(header.Linkname)
+ if strings.HasPrefix(linkTarget, "..") || filepath.IsAbs(linkTarget) {
+ continue
+ }
+ }
+
// force PAX format to remove Name/Linkname length limit of 100 characters
// required by USTAR and to not depend on internal tar package guess which
// prefers USTAR over PAX
diff --git a/vendor/github.com/google/go-containerregistry/pkg/v1/tarball/image.go b/vendor/github.com/google/go-containerregistry/pkg/v1/tarball/image.go
index aba609deac..96c0cce49d 100644
--- a/vendor/github.com/google/go-containerregistry/pkg/v1/tarball/image.go
+++ b/vendor/github.com/google/go-containerregistry/pkg/v1/tarball/image.go
@@ -219,6 +219,15 @@ type tarFile struct {
}
func extractFileFromTar(opener Opener, filePath string) (io.ReadCloser, error) {
+ return followLinks(opener, filePath, make(map[string]bool))
+}
+
+func followLinks(opener Opener, filePath string, visited map[string]bool) (io.ReadCloser, error) {
+ if visited[filePath] {
+ return nil, fmt.Errorf("link cycle detected for %s", filePath)
+ }
+ visited[filePath] = true
+
f, err := opener()
if err != nil {
return nil, err
@@ -242,7 +251,7 @@ func extractFileFromTar(opener Opener, filePath string) (io.ReadCloser, error) {
if hdr.Name == filePath {
if hdr.Typeflag == tar.TypeSymlink || hdr.Typeflag == tar.TypeLink {
currentDir := filepath.Dir(filePath)
- return extractFileFromTar(opener, path.Join(currentDir, path.Clean(hdr.Linkname)))
+ return followLinks(opener, path.Join(currentDir, path.Clean(hdr.Linkname)), visited)
}
needClose = false
return tarFile{
diff --git a/vendor/github.com/sirupsen/logrus/.golangci.yml b/vendor/github.com/sirupsen/logrus/.golangci.yml
index 65dc285037..792db36181 100644
--- a/vendor/github.com/sirupsen/logrus/.golangci.yml
+++ b/vendor/github.com/sirupsen/logrus/.golangci.yml
@@ -1,40 +1,67 @@
+version: "2"
run:
- # do not run on test files yet
tests: false
-
-# all available settings of specific linters
-linters-settings:
- errcheck:
- # report about not checking of errors in type assetions: `a := b.(MyStruct)`;
- # default is false: such cases aren't reported by default.
- check-type-assertions: false
-
- # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
- # default is false: such cases aren't reported by default.
- check-blank: false
-
- lll:
- line-length: 100
- tab-width: 4
-
- prealloc:
- simple: false
- range-loops: false
- for-loops: false
-
- whitespace:
- multi-if: false # Enforces newlines (or comments) after every multi-line if statement
- multi-func: false # Enforces newlines (or comments) after every multi-line function signature
-
linters:
enable:
- - megacheck
- - govet
+ - asasalint
+ - asciicheck
+ - bidichk
+ - bodyclose
+ - contextcheck
+ - durationcheck
+ - errchkjson
+ - errorlint
+ - exhaustive
+ - gocheckcompilerdirectives
+ - gochecksumtype
+ - gosec
+ - gosmopolitan
+ - loggercheck
+ - makezero
+ - musttag
+ - nilerr
+ - nilnesserr
+ - noctx
+ - protogetter
+ - reassign
+ - recvcheck
+ - rowserrcheck
+ - spancheck
+ - sqlclosecheck
+ - testifylint
+ - unparam
+ - zerologlint
disable:
- - maligned
- prealloc
- disable-all: false
- presets:
- - bugs
- - unused
- fast: false
+ settings:
+ errcheck:
+ check-type-assertions: false
+ check-blank: false
+ lll:
+ line-length: 100
+ tab-width: 4
+ prealloc:
+ simple: false
+ range-loops: false
+ for-loops: false
+ whitespace:
+ multi-if: false
+ multi-func: false
+ exclusions:
+ generated: lax
+ presets:
+ - comments
+ - common-false-positives
+ - legacy
+ - std-error-handling
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+formatters:
+ exclusions:
+ generated: lax
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md
index 7567f61289..098608ff4b 100644
--- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md
+++ b/vendor/github.com/sirupsen/logrus/CHANGELOG.md
@@ -37,7 +37,7 @@ Features:
# 1.6.0
Fixes:
* end of line cleanup
- * revert the entry concurrency bug fix whic leads to deadlock under some circumstances
+ * revert the entry concurrency bug fix which leads to deadlock under some circumstances
* update dependency on go-windows-terminal-sequences to fix a crash with go 1.14
Features:
@@ -129,7 +129,7 @@ This new release introduces:
which is mostly useful for logger wrapper
* a fix reverting the immutability of the entry given as parameter to the hooks
a new configuration field of the json formatter in order to put all the fields
- in a nested dictionnary
+ in a nested dictionary
* a new SetOutput method in the Logger
* a new configuration of the textformatter to configure the name of the default keys
* a new configuration of the text formatter to disable the level truncation
diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md
index d1d4a85fd7..cc5dab7eb7 100644
--- a/vendor/github.com/sirupsen/logrus/README.md
+++ b/vendor/github.com/sirupsen/logrus/README.md
@@ -1,4 +1,4 @@
-# Logrus
[](https://github.com/sirupsen/logrus/actions?query=workflow%3ACI) [](https://travis-ci.org/sirupsen/logrus) [](https://pkg.go.dev/github.com/sirupsen/logrus)
+# Logrus
[](https://github.com/sirupsen/logrus/actions?query=workflow%3ACI) [](https://pkg.go.dev/github.com/sirupsen/logrus)
Logrus is a structured logger for Go (golang), completely API compatible with
the standard library logger.
@@ -40,7 +40,7 @@ plain text):

-With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash
+With `logrus.SetFormatter(&logrus.JSONFormatter{})`, for easy parsing by logstash
or Splunk:
```text
@@ -60,9 +60,9 @@ ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"}
"time":"2014-03-10 19:57:38.562543128 -0400 EDT"}
```
-With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not
+With the default `logrus.SetFormatter(&logrus.TextFormatter{})` when a TTY is not
attached, the output is compatible with the
-[logfmt](http://godoc.org/github.com/kr/logfmt) format:
+[logfmt](https://pkg.go.dev/github.com/kr/logfmt) format:
```text
time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8
@@ -75,17 +75,18 @@ time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x20822
To ensure this behaviour even if a TTY is attached, set your formatter as follows:
```go
- log.SetFormatter(&log.TextFormatter{
- DisableColors: true,
- FullTimestamp: true,
- })
+logrus.SetFormatter(&logrus.TextFormatter{
+ DisableColors: true,
+ FullTimestamp: true,
+})
```
#### Logging Method Name
If you wish to add the calling method as a field, instruct the logger via:
+
```go
-log.SetReportCaller(true)
+logrus.SetReportCaller(true)
```
This adds the caller as 'method' like so:
@@ -100,11 +101,11 @@ time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcr
Note that this does add measurable overhead - the cost will depend on the version of Go, but is
between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your
environment via benchmarks:
-```
+
+```bash
go test -bench=.*CallerTracing
```
-
#### Case-sensitivity
The organization's name was changed to lower-case--and this will not be changed
@@ -118,12 +119,10 @@ The simplest way to use Logrus is simply the package-level exported logger:
```go
package main
-import (
- log "github.com/sirupsen/logrus"
-)
+import "github.com/sirupsen/logrus"
func main() {
- log.WithFields(log.Fields{
+ logrus.WithFields(logrus.Fields{
"animal": "walrus",
}).Info("A walrus appears")
}
@@ -139,6 +138,7 @@ package main
import (
"os"
+
log "github.com/sirupsen/logrus"
)
@@ -190,26 +190,27 @@ package main
import (
"os"
+
"github.com/sirupsen/logrus"
)
// Create a new instance of the logger. You can have any number of instances.
-var log = logrus.New()
+var logger = logrus.New()
func main() {
// The API for setting attributes is a little different than the package level
- // exported logger. See Godoc.
- log.Out = os.Stdout
+ // exported logger. See Godoc.
+ logger.Out = os.Stdout
// You could set this to any `io.Writer` such as a file
// file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
// if err == nil {
- // log.Out = file
+ // logger.Out = file
// } else {
- // log.Info("Failed to log to file, using default stderr")
+ // logger.Info("Failed to log to file, using default stderr")
// }
- log.WithFields(logrus.Fields{
+ logger.WithFields(logrus.Fields{
"animal": "walrus",
"size": 10,
}).Info("A group of walrus emerges from the ocean")
@@ -219,12 +220,12 @@ func main() {
#### Fields
Logrus encourages careful, structured logging through logging fields instead of
-long, unparseable error messages. For example, instead of: `log.Fatalf("Failed
+long, unparseable error messages. For example, instead of: `logrus.Fatalf("Failed
to send event %s to topic %s with key %d")`, you should log the much more
discoverable:
```go
-log.WithFields(log.Fields{
+logrus.WithFields(logrus.Fields{
"event": event,
"topic": topic,
"key": key,
@@ -245,12 +246,12 @@ seen as a hint you should add a field, however, you can still use the
Often it's helpful to have fields _always_ attached to log statements in an
application or parts of one. For example, you may want to always log the
`request_id` and `user_ip` in the context of a request. Instead of writing
-`log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})` on
+`logger.WithFields(logrus.Fields{"request_id": request_id, "user_ip": user_ip})` on
every line, you can create a `logrus.Entry` to pass around instead:
```go
-requestLogger := log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})
-requestLogger.Info("something happened on that request") # will log request_id and user_ip
+requestLogger := logger.WithFields(logrus.Fields{"request_id": request_id, "user_ip": user_ip})
+requestLogger.Info("something happened on that request") // will log request_id and user_ip
requestLogger.Warn("something not great happened")
```
@@ -264,28 +265,31 @@ Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in
`init`:
```go
+package main
+
import (
- log "github.com/sirupsen/logrus"
- "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "airbrake"
- logrus_syslog "github.com/sirupsen/logrus/hooks/syslog"
"log/syslog"
+
+ "github.com/sirupsen/logrus"
+ airbrake "gopkg.in/gemnasium/logrus-airbrake-hook.v2"
+ logrus_syslog "github.com/sirupsen/logrus/hooks/syslog"
)
func init() {
// Use the Airbrake hook to report errors that have Error severity or above to
// an exception tracker. You can create custom hooks, see the Hooks section.
- log.AddHook(airbrake.NewHook(123, "xyz", "production"))
+ logrus.AddHook(airbrake.NewHook(123, "xyz", "production"))
hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "")
if err != nil {
- log.Error("Unable to connect to local syslog daemon")
+ logrus.Error("Unable to connect to local syslog daemon")
} else {
- log.AddHook(hook)
+ logrus.AddHook(hook)
}
}
```
-Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md).
+Note: Syslog hooks also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md).
A list of currently known service hooks can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks)
@@ -295,15 +299,15 @@ A list of currently known service hooks can be found in this wiki [page](https:/
Logrus has seven logging levels: Trace, Debug, Info, Warning, Error, Fatal and Panic.
```go
-log.Trace("Something very low level.")
-log.Debug("Useful debugging information.")
-log.Info("Something noteworthy happened!")
-log.Warn("You should probably take a look at this.")
-log.Error("Something failed but I'm not quitting.")
+logrus.Trace("Something very low level.")
+logrus.Debug("Useful debugging information.")
+logrus.Info("Something noteworthy happened!")
+logrus.Warn("You should probably take a look at this.")
+logrus.Error("Something failed but I'm not quitting.")
// Calls os.Exit(1) after logging
-log.Fatal("Bye.")
+logrus.Fatal("Bye.")
// Calls panic() after logging
-log.Panic("I'm bailing.")
+logrus.Panic("I'm bailing.")
```
You can set the logging level on a `Logger`, then it will only log entries with
@@ -311,13 +315,13 @@ that severity or anything above it:
```go
// Will log anything that is info or above (warn, error, fatal, panic). Default.
-log.SetLevel(log.InfoLevel)
+logrus.SetLevel(logrus.InfoLevel)
```
-It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose
+It may be useful to set `logrus.Level = logrus.DebugLevel` in a debug or verbose
environment if your application has that.
-Note: If you want different log levels for global (`log.SetLevel(...)`) and syslog logging, please check the [syslog hook README](hooks/syslog/README.md#different-log-levels-for-local-and-remote-logging).
+Note: If you want different log levels for global (`logrus.SetLevel(...)`) and syslog logging, please check the [syslog hook README](hooks/syslog/README.md#different-log-levels-for-local-and-remote-logging).
#### Entries
@@ -340,17 +344,17 @@ could do:
```go
import (
- log "github.com/sirupsen/logrus"
+ "github.com/sirupsen/logrus"
)
func init() {
// do something here to set environment depending on an environment variable
// or command-line flag
if Environment == "production" {
- log.SetFormatter(&log.JSONFormatter{})
+ logrus.SetFormatter(&logrus.JSONFormatter{})
} else {
// The TextFormatter is default, you don't actually have to do this.
- log.SetFormatter(&log.TextFormatter{})
+ logrus.SetFormatter(&logrus.TextFormatter{})
}
}
```
@@ -372,11 +376,11 @@ The built-in logging formatters are:
* When colors are enabled, levels are truncated to 4 characters by default. To disable
truncation set the `DisableLevelTruncation` field to `true`.
* When outputting to a TTY, it's often helpful to visually scan down a column where all the levels are the same width. Setting the `PadLevelText` field to `true` enables this behavior, by adding padding to the level text.
- * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter).
+ * All options are listed in the [generated docs](https://pkg.go.dev/github.com/sirupsen/logrus#TextFormatter).
* `logrus.JSONFormatter`. Logs fields as JSON.
- * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter).
+ * All options are listed in the [generated docs](https://pkg.go.dev/github.com/sirupsen/logrus#JSONFormatter).
-Third party logging formatters:
+Third-party logging formatters:
* [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine.
* [`GELF`](https://github.com/fabienm/go-logrus-formatters). Formats entries so they comply to Graylog's [GELF 1.1 specification](http://docs.graylog.org/en/2.4/pages/gelf.html).
@@ -384,7 +388,7 @@ Third party logging formatters:
* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout.
* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the Power of Zalgo.
* [`nested-logrus-formatter`](https://github.com/antonfisher/nested-logrus-formatter). Converts logrus fields to a nested structure.
-* [`powerful-logrus-formatter`](https://github.com/zput/zxcTool). get fileName, log's line number and the latest function's name when print log; Sava log to files.
+* [`powerful-logrus-formatter`](https://github.com/zput/zxcTool). get fileName, log's line number and the latest function's name when print log; Save log to files.
* [`caption-json-formatter`](https://github.com/nolleh/caption_json_formatter). logrus's message json formatter with human-readable caption added.
You can define your formatter by implementing the `Formatter` interface,
@@ -393,10 +397,9 @@ requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a
default ones (see Entries section above):
```go
-type MyJSONFormatter struct {
-}
+type MyJSONFormatter struct{}
-log.SetFormatter(new(MyJSONFormatter))
+logrus.SetFormatter(new(MyJSONFormatter))
func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) {
// Note this doesn't include Time, Level and Message which are available on
@@ -455,17 +458,18 @@ entries. It should not be a feature of the application-level logger.
#### Testing
-Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides:
+Logrus has a built-in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides:
* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just adds the `test` hook
* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any):
```go
import(
+ "testing"
+
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus/hooks/test"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestSomething(t*testing.T){
@@ -486,15 +490,15 @@ func TestSomething(t*testing.T){
Logrus can register one or more functions that will be called when any `fatal`
level message is logged. The registered handlers will be executed before
logrus performs an `os.Exit(1)`. This behavior may be helpful if callers need
-to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted.
+to gracefully shut down. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted.
-```
-...
+```go
+// ...
handler := func() {
- // gracefully shutdown something...
+ // gracefully shut down something...
}
logrus.RegisterExitHandler(handler)
-...
+// ...
```
#### Thread safety
@@ -502,7 +506,7 @@ logrus.RegisterExitHandler(handler)
By default, Logger is protected by a mutex for concurrent writes. The mutex is held when calling hooks and writing logs.
If you are sure such locking is not needed, you can call logger.SetNoLock() to disable the locking.
-Situation when locking is not needed includes:
+Situations when locking is not needed include:
* You have no hooks registered, or hooks calling is already thread-safe.
diff --git a/vendor/github.com/sirupsen/logrus/appveyor.yml b/vendor/github.com/sirupsen/logrus/appveyor.yml
index df9d65c3a5..e90f09ea68 100644
--- a/vendor/github.com/sirupsen/logrus/appveyor.yml
+++ b/vendor/github.com/sirupsen/logrus/appveyor.yml
@@ -1,14 +1,12 @@
-version: "{build}"
+# Minimal stub to satisfy AppVeyor CI
+version: 1.0.{build}
platform: x64
-clone_folder: c:\gopath\src\github.com\sirupsen\logrus
-environment:
- GOPATH: c:\gopath
+shallow_clone: true
+
branches:
only:
- master
-install:
- - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
- - go version
+ - main
+
build_script:
- - go get -t
- - go test
+ - echo "No-op build to satisfy AppVeyor CI"
diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go
index 71cdbbc35d..71d796d0b1 100644
--- a/vendor/github.com/sirupsen/logrus/entry.go
+++ b/vendor/github.com/sirupsen/logrus/entry.go
@@ -34,13 +34,15 @@ func init() {
minimumCallerDepth = 1
}
-// Defines the key when adding errors using WithError.
+// ErrorKey defines the key when adding errors using [WithError], [Logger.WithError].
var ErrorKey = "error"
-// An entry is the final or intermediate Logrus logging entry. It contains all
+// Entry is the final or intermediate Logrus logging entry. It contains all
// the fields passed with WithField{,s}. It's finally logged when Trace, Debug,
// Info, Warn, Error, Fatal or Panic is called on it. These objects can be
// reused and passed around as much as you wish to avoid field duplication.
+//
+//nolint:recvcheck // the methods of "Entry" use pointer receiver and non-pointer receiver.
type Entry struct {
Logger *Logger
@@ -86,12 +88,12 @@ func (entry *Entry) Dup() *Entry {
return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, Context: entry.Context, err: entry.err}
}
-// Returns the bytes representation of this entry from the formatter.
+// Bytes returns the bytes representation of this entry from the formatter.
func (entry *Entry) Bytes() ([]byte, error) {
return entry.Logger.Formatter.Format(entry)
}
-// Returns the string representation from the reader and ultimately the
+// String returns the string representation from the reader and ultimately the
// formatter.
func (entry *Entry) String() (string, error) {
serialized, err := entry.Bytes()
@@ -102,12 +104,13 @@ func (entry *Entry) String() (string, error) {
return str, nil
}
-// Add an error as single field (using the key defined in ErrorKey) to the Entry.
+// WithError adds an error as single field (using the key defined in [ErrorKey])
+// to the Entry.
func (entry *Entry) WithError(err error) *Entry {
return entry.WithField(ErrorKey, err)
}
-// Add a context to the Entry.
+// WithContext adds a context to the Entry.
func (entry *Entry) WithContext(ctx context.Context) *Entry {
dataCopy := make(Fields, len(entry.Data))
for k, v := range entry.Data {
@@ -116,12 +119,12 @@ func (entry *Entry) WithContext(ctx context.Context) *Entry {
return &Entry{Logger: entry.Logger, Data: dataCopy, Time: entry.Time, err: entry.err, Context: ctx}
}
-// Add a single field to the Entry.
+// WithField adds a single field to the Entry.
func (entry *Entry) WithField(key string, value interface{}) *Entry {
return entry.WithFields(Fields{key: value})
}
-// Add a map of fields to the Entry.
+// WithFields adds a map of fields to the Entry.
func (entry *Entry) WithFields(fields Fields) *Entry {
data := make(Fields, len(entry.Data)+len(fields))
for k, v := range entry.Data {
@@ -150,7 +153,7 @@ func (entry *Entry) WithFields(fields Fields) *Entry {
return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, err: fieldErr, Context: entry.Context}
}
-// Overrides the time of the Entry.
+// WithTime overrides the time of the Entry.
func (entry *Entry) WithTime(t time.Time) *Entry {
dataCopy := make(Fields, len(entry.Data))
for k, v := range entry.Data {
@@ -204,7 +207,7 @@ func getCaller() *runtime.Frame {
// If the caller isn't part of this package, we're done
if pkg != logrusPackage {
- return &f //nolint:scopelint
+ return &f
}
}
@@ -432,7 +435,7 @@ func (entry *Entry) Panicln(args ...interface{}) {
entry.Logln(PanicLevel, args...)
}
-// Sprintlnn => Sprint no newline. This is to get the behavior of how
+// sprintlnn => Sprint no newline. This is to get the behavior of how
// fmt.Sprintln where spaces are always added between operands, regardless of
// their type. Instead of vendoring the Sprintln implementation to spare a
// string allocation, we do the simplest thing.
diff --git a/vendor/github.com/sirupsen/logrus/hooks.go b/vendor/github.com/sirupsen/logrus/hooks.go
index 3f151cdc39..9ab978a457 100644
--- a/vendor/github.com/sirupsen/logrus/hooks.go
+++ b/vendor/github.com/sirupsen/logrus/hooks.go
@@ -1,16 +1,16 @@
package logrus
-// A hook to be fired when logging on the logging levels returned from
-// `Levels()` on your implementation of the interface. Note that this is not
+// Hook describes hooks to be fired when logging on the logging levels returned from
+// [Hook.Levels] on your implementation of the interface. Note that this is not
// fired in a goroutine or a channel with workers, you should handle such
-// functionality yourself if your call is non-blocking and you don't wish for
+// functionality yourself if your call is non-blocking, and you don't wish for
// the logging calls for levels returned from `Levels()` to block.
type Hook interface {
Levels() []Level
Fire(*Entry) error
}
-// Internal type for storing the hooks on a logger instance.
+// LevelHooks is an internal type for storing the hooks on a logger instance.
type LevelHooks map[Level][]Hook
// Add a hook to an instance of logger. This is called with
diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go
index 5ff0aef6d3..f5b8c439ee 100644
--- a/vendor/github.com/sirupsen/logrus/logger.go
+++ b/vendor/github.com/sirupsen/logrus/logger.go
@@ -72,16 +72,16 @@ func (mw *MutexWrap) Disable() {
mw.disabled = true
}
-// Creates a new logger. Configuration should be set by changing `Formatter`,
-// `Out` and `Hooks` directly on the default logger instance. You can also just
+// New Creates a new logger. Configuration should be set by changing [Formatter],
+// Out and Hooks directly on the default Logger instance. You can also just
// instantiate your own:
//
-// var log = &logrus.Logger{
-// Out: os.Stderr,
-// Formatter: new(logrus.TextFormatter),
-// Hooks: make(logrus.LevelHooks),
-// Level: logrus.DebugLevel,
-// }
+// var log = &logrus.Logger{
+// Out: os.Stderr,
+// Formatter: new(logrus.TextFormatter),
+// Hooks: make(logrus.LevelHooks),
+// Level: logrus.DebugLevel,
+// }
//
// It's recommended to make this a global instance called `log`.
func New() *Logger {
@@ -118,30 +118,30 @@ func (logger *Logger) WithField(key string, value interface{}) *Entry {
return entry.WithField(key, value)
}
-// Adds a struct of fields to the log entry. All it does is call `WithField` for
-// each `Field`.
+// WithFields adds a struct of fields to the log entry. It calls [Entry.WithField]
+// for each Field.
func (logger *Logger) WithFields(fields Fields) *Entry {
entry := logger.newEntry()
defer logger.releaseEntry(entry)
return entry.WithFields(fields)
}
-// Add an error as single field to the log entry. All it does is call
-// `WithError` for the given `error`.
+// WithError adds an error as single field to the log entry. It calls
+// [Entry.WithError] for the given error.
func (logger *Logger) WithError(err error) *Entry {
entry := logger.newEntry()
defer logger.releaseEntry(entry)
return entry.WithError(err)
}
-// Add a context to the log entry.
+// WithContext add a context to the log entry.
func (logger *Logger) WithContext(ctx context.Context) *Entry {
entry := logger.newEntry()
defer logger.releaseEntry(entry)
return entry.WithContext(ctx)
}
-// Overrides the time of the log entry.
+// WithTime overrides the time of the log entry.
func (logger *Logger) WithTime(t time.Time) *Entry {
entry := logger.newEntry()
defer logger.releaseEntry(entry)
@@ -347,9 +347,9 @@ func (logger *Logger) Exit(code int) {
logger.ExitFunc(code)
}
-//When file is opened with appending mode, it's safe to
-//write concurrently to a file (within 4k message on Linux).
-//In these cases user can choose to disable the lock.
+// SetNoLock disables the lock for situations where a file is opened with
+// appending mode, and safe for concurrent writes to the file (within 4k
+// message on Linux). In these cases user can choose to disable the lock.
func (logger *Logger) SetNoLock() {
logger.mu.Disable()
}
diff --git a/vendor/github.com/sirupsen/logrus/logrus.go b/vendor/github.com/sirupsen/logrus/logrus.go
index 2f16224cb9..37fc4fef85 100644
--- a/vendor/github.com/sirupsen/logrus/logrus.go
+++ b/vendor/github.com/sirupsen/logrus/logrus.go
@@ -6,13 +6,15 @@ import (
"strings"
)
-// Fields type, used to pass to `WithFields`.
+// Fields type, used to pass to [WithFields].
type Fields map[string]interface{}
// Level type
+//
+//nolint:recvcheck // the methods of "Entry" use pointer receiver and non-pointer receiver.
type Level uint32
-// Convert the Level to a string. E.g. PanicLevel becomes "panic".
+// Convert the Level to a string. E.g. [PanicLevel] becomes "panic".
func (level Level) String() string {
if b, err := level.MarshalText(); err == nil {
return string(b)
@@ -77,7 +79,7 @@ func (level Level) MarshalText() ([]byte, error) {
return nil, fmt.Errorf("not a valid logrus level %d", level)
}
-// A constant exposing all logging levels
+// AllLevels exposing all logging levels.
var AllLevels = []Level{
PanicLevel,
FatalLevel,
@@ -119,8 +121,8 @@ var (
)
// StdLogger is what your logrus-enabled library should take, that way
-// it'll accept a stdlib logger and a logrus logger. There's no standard
-// interface, this is the closest we get, unfortunately.
+// it'll accept a stdlib logger ([log.Logger]) and a logrus logger.
+// There's no standard interface, so this is the closest we get, unfortunately.
type StdLogger interface {
Print(...interface{})
Printf(string, ...interface{})
@@ -135,7 +137,8 @@ type StdLogger interface {
Panicln(...interface{})
}
-// The FieldLogger interface generalizes the Entry and Logger types
+// FieldLogger extends the [StdLogger] interface, generalizing
+// the [Entry] and [Logger] types.
type FieldLogger interface {
WithField(key string, value interface{}) *Entry
WithFields(fields Fields) *Entry
@@ -176,8 +179,9 @@ type FieldLogger interface {
// IsPanicEnabled() bool
}
-// Ext1FieldLogger (the first extension to FieldLogger) is superfluous, it is
-// here for consistancy. Do not use. Use Logger or Entry instead.
+// Ext1FieldLogger (the first extension to [FieldLogger]) is superfluous, it is
+// here for consistency. Do not use. Use [FieldLogger], [Logger] or [Entry]
+// instead.
type Ext1FieldLogger interface {
FieldLogger
Tracef(format string, args ...interface{})
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go b/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
index 499789984d..69956b425a 100644
--- a/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
+++ b/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
@@ -1,4 +1,4 @@
-// +build darwin dragonfly freebsd netbsd openbsd
+// +build darwin dragonfly freebsd netbsd openbsd hurd
// +build !js
package logrus
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go
index 04748b8515..c9aed267a4 100644
--- a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go
+++ b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go
@@ -1,5 +1,7 @@
+//go:build (linux || aix || zos) && !js && !wasi
// +build linux aix zos
// +build !js
+// +build !wasi
package logrus
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_wasi.go b/vendor/github.com/sirupsen/logrus/terminal_check_wasi.go
new file mode 100644
index 0000000000..2822b212fb
--- /dev/null
+++ b/vendor/github.com/sirupsen/logrus/terminal_check_wasi.go
@@ -0,0 +1,8 @@
+//go:build wasi
+// +build wasi
+
+package logrus
+
+func isTerminal(fd int) bool {
+ return false
+}
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_wasip1.go b/vendor/github.com/sirupsen/logrus/terminal_check_wasip1.go
new file mode 100644
index 0000000000..108a6be12b
--- /dev/null
+++ b/vendor/github.com/sirupsen/logrus/terminal_check_wasip1.go
@@ -0,0 +1,8 @@
+//go:build wasip1
+// +build wasip1
+
+package logrus
+
+func isTerminal(fd int) bool {
+ return false
+}
diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go
index be2c6efe5e..6dfeb18b10 100644
--- a/vendor/github.com/sirupsen/logrus/text_formatter.go
+++ b/vendor/github.com/sirupsen/logrus/text_formatter.go
@@ -306,6 +306,7 @@ func (f *TextFormatter) needsQuoting(text string) bool {
return false
}
for _, ch := range text {
+ //nolint:staticcheck // QF1001: could apply De Morgan's law
if !((ch >= 'a' && ch <= 'z') ||
(ch >= 'A' && ch <= 'Z') ||
(ch >= '0' && ch <= '9') ||
@@ -334,6 +335,6 @@ func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) {
if !f.needsQuoting(stringVal) {
b.WriteString(stringVal)
} else {
- b.WriteString(fmt.Sprintf("%q", stringVal))
+ fmt.Fprintf(b, "%q", stringVal)
}
}
diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go
index eeed1e92b0..2fd3c57597 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/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go
index 6320f4eb4c..0b99d832fa 100644
--- a/vendor/golang.org/x/net/http2/http2.go
+++ b/vendor/golang.org/x/net/http2/http2.go
@@ -4,13 +4,17 @@
// Package http2 implements the HTTP/2 protocol.
//
-// This package is low-level and intended to be used directly by very
-// few people. Most users will use it indirectly through the automatic
-// use by the net/http package (from Go 1.6 and later).
-// For use in earlier Go versions see ConfigureServer. (Transport support
-// requires Go 1.6 or later)
+// Almost no users should need to import this package directly.
+// The net/http package supports HTTP/2 natively.
//
-// See https://http2.github.io/ for more information on HTTP/2.
+// To enable or disable HTTP/2 support in net/http clients and servers, see
+// [http.Transport.Protocols] and [http.Server.Protocols].
+//
+// To configure HTTP/2 parameters, see
+// [http.Transport.HTTP2] and [http.Server.HTTP2].
+//
+// To create HTTP/1 or HTTP/2 connections, see
+// [http.Transport.NewClientConn].
package http2 // import "golang.org/x/net/http2"
import (
diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go
index 7ef807f79d..65da5175c9 100644
--- a/vendor/golang.org/x/net/http2/server.go
+++ b/vendor/golang.org/x/net/http2/server.go
@@ -164,6 +164,8 @@ type Server struct {
// NewWriteScheduler constructs a write scheduler for a connection.
// If nil, a default scheduler is chosen.
+ //
+ // Deprecated: User-provided write schedulers are deprecated.
NewWriteScheduler func() WriteScheduler
// CountError, if non-nil, is called on HTTP/2 server errors.
diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go
index 8cf64b78e2..2e9c2f6a52 100644
--- a/vendor/golang.org/x/net/http2/transport.go
+++ b/vendor/golang.org/x/net/http2/transport.go
@@ -712,10 +712,6 @@ func canRetryError(err error) bool {
return true
}
if se, ok := err.(StreamError); ok {
- if se.Code == ErrCodeProtocol && se.Cause == errFromPeer {
- // See golang/go#47635, golang/go#42777
- return true
- }
return se.Code == ErrCodeRefusedStream
}
return false
@@ -3233,10 +3229,6 @@ func (gz *gzipReader) Close() error {
return gz.body.Close()
}
-type errorReader struct{ err error }
-
-func (r errorReader) Read(p []byte) (int, error) { return 0, r.err }
-
// isConnectionCloseRequest reports whether req should use its own
// connection for a single request and then close the connection.
func isConnectionCloseRequest(req *http.Request) bool {
diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go
index 7de27be525..551545f313 100644
--- a/vendor/golang.org/x/net/http2/writesched.go
+++ b/vendor/golang.org/x/net/http2/writesched.go
@@ -8,6 +8,8 @@ import "fmt"
// WriteScheduler is the interface implemented by HTTP/2 write schedulers.
// Methods are never called concurrently.
+//
+// Deprecated: User-provided write schedulers are deprecated.
type WriteScheduler interface {
// OpenStream opens a new stream in the write scheduler.
// It is illegal to call this with streamID=0 or with a streamID that is
@@ -38,6 +40,8 @@ type WriteScheduler interface {
}
// OpenStreamOptions specifies extra options for WriteScheduler.OpenStream.
+//
+// Deprecated: User-provided write schedulers are deprecated.
type OpenStreamOptions struct {
// PusherID is zero if the stream was initiated by the client. Otherwise,
// PusherID names the stream that pushed the newly opened stream.
@@ -47,6 +51,8 @@ type OpenStreamOptions struct {
}
// FrameWriteRequest is a request to write a frame.
+//
+// Deprecated: User-provided write schedulers are deprecated.
type FrameWriteRequest struct {
// write is the interface value that does the writing, once the
// WriteScheduler has selected this frame to write. The write
diff --git a/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go b/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go
index 7803a9261b..c3d3e9bed6 100644
--- a/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go
+++ b/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go
@@ -14,6 +14,8 @@ import (
const priorityDefaultWeightRFC7540 = 15 // 16 = 15 + 1
// PriorityWriteSchedulerConfig configures a priorityWriteScheduler.
+//
+// Deprecated: User-provided write schedulers are deprecated.
type PriorityWriteSchedulerConfig struct {
// MaxClosedNodesInTree controls the maximum number of closed streams to
// retain in the priority tree. Setting this to zero saves a small amount
@@ -55,6 +57,9 @@ type PriorityWriteSchedulerConfig struct {
// NewPriorityWriteScheduler constructs a WriteScheduler that schedules
// frames by following HTTP/2 priorities as described in RFC 7540 Section 5.3.
// If cfg is nil, default options are used.
+//
+// Deprecated: The RFC 7540 write scheduler has known bugs and performance issues,
+// and RFC 7540 prioritization was deprecated in RFC 9113.
func NewPriorityWriteScheduler(cfg *PriorityWriteSchedulerConfig) WriteScheduler {
return newPriorityWriteSchedulerRFC7540(cfg)
}
diff --git a/vendor/golang.org/x/net/http2/writesched_random.go b/vendor/golang.org/x/net/http2/writesched_random.go
index f2e55e05ce..d5d4e22148 100644
--- a/vendor/golang.org/x/net/http2/writesched_random.go
+++ b/vendor/golang.org/x/net/http2/writesched_random.go
@@ -10,6 +10,8 @@ import "math"
// priorities. Control frames like SETTINGS and PING are written before DATA
// frames, but if no control frames are queued and multiple streams have queued
// HEADERS or DATA frames, Pop selects a ready stream arbitrarily.
+//
+// Deprecated: User-provided write schedulers are deprecated.
func NewRandomWriteScheduler() WriteScheduler {
return &randomWriteScheduler{sq: make(map[uint32]*writeQueue)}
}
diff --git a/vendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s b/vendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s
new file mode 100644
index 0000000000..e07fa75eb5
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s
@@ -0,0 +1,12 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build darwin && arm64 && gc
+
+#include "textflag.h"
+
+TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_sysctlbyname(SB)
+GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB)
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
index 6d8eb784b5..5fc09e2935 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
@@ -44,14 +44,11 @@ func initOptions() {
}
func archInit() {
- switch runtime.GOOS {
- case "freebsd":
+ if runtime.GOOS == "freebsd" {
readARM64Registers()
- case "linux", "netbsd", "openbsd", "windows":
+ } else {
+ // Most platforms don't seem to allow directly reading these registers.
doinit()
- default:
- // Many platforms don't seem to allow reading these registers.
- setMinimalFeatures()
}
}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go
new file mode 100644
index 0000000000..0b470744a0
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go
@@ -0,0 +1,67 @@
+// Copyright 2026 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build darwin && arm64 && gc
+
+package cpu
+
+func doinit() {
+ setMinimalFeatures()
+
+ // The feature flags are explained in [Instruction Set Detection].
+ // There are some differences between MacOS versions:
+ //
+ // MacOS 11 and 12 do not have "hw.optional" sysctl values for some of the features.
+ //
+ // MacOS 13 changed some of the naming conventions to align with ARM Architecture Reference Manual.
+ // For example "hw.optional.armv8_2_sha512" became "hw.optional.arm.FEAT_SHA512".
+ // It currently checks both to stay compatible with MacOS 11 and 12.
+ // The old names also work with MacOS 13, however it's not clear whether
+ // they will continue working with future OS releases.
+ //
+ // Once MacOS 12 is no longer supported the old names can be removed.
+ //
+ // [Instruction Set Detection]: https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
+
+ // Encryption, hashing and checksum capabilities
+
+ // For the following flags there are no MacOS 11 sysctl flags.
+ ARM64.HasAES = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_AES\x00"))
+ ARM64.HasPMULL = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_PMULL\x00"))
+ ARM64.HasSHA1 = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA1\x00"))
+ ARM64.HasSHA2 = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA256\x00"))
+
+ ARM64.HasSHA3 = darwinSysctlEnabled([]byte("hw.optional.armv8_2_sha3\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA3\x00"))
+ ARM64.HasSHA512 = darwinSysctlEnabled([]byte("hw.optional.armv8_2_sha512\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA512\x00"))
+
+ ARM64.HasCRC32 = darwinSysctlEnabled([]byte("hw.optional.armv8_crc32\x00"))
+
+ // Atomic and memory ordering
+ ARM64.HasATOMICS = darwinSysctlEnabled([]byte("hw.optional.armv8_1_atomics\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_LSE\x00"))
+ ARM64.HasLRCPC = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_LRCPC\x00"))
+
+ // SIMD and floating point capabilities
+ ARM64.HasFPHP = darwinSysctlEnabled([]byte("hw.optional.neon_fp16\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FP16\x00"))
+ ARM64.HasASIMDHP = darwinSysctlEnabled([]byte("hw.optional.neon_hpfp\x00")) || darwinSysctlEnabled([]byte("hw.optional.AdvSIMD_HPFPCvt\x00"))
+ ARM64.HasASIMDRDM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_RDM\x00"))
+ ARM64.HasASIMDDP = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DotProd\x00"))
+ ARM64.HasASIMDFHM = darwinSysctlEnabled([]byte("hw.optional.armv8_2_fhm\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FHM\x00"))
+ ARM64.HasI8MM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_I8MM\x00"))
+
+ ARM64.HasJSCVT = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_JSCVT\x00"))
+ ARM64.HasFCMA = darwinSysctlEnabled([]byte("hw.optional.armv8_3_compnum\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FCMA\x00"))
+
+ // Miscellaneous
+ ARM64.HasDCPOP = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DPB\x00"))
+ ARM64.HasEVTSTRM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_ECV\x00"))
+ ARM64.HasDIT = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DIT\x00"))
+
+ // Not supported, but added for completeness
+ ARM64.HasCPUID = false
+
+ ARM64.HasSM3 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SM3\x00"))
+ ARM64.HasSM4 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SM4\x00"))
+ ARM64.HasSVE = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SVE\x00"))
+ ARM64.HasSVE2 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SVE2\x00"))
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go
new file mode 100644
index 0000000000..4ee68e38d9
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go
@@ -0,0 +1,29 @@
+// Copyright 2026 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build darwin && arm64 && !gc
+
+package cpu
+
+func doinit() {
+ setMinimalFeatures()
+
+ ARM64.HasASIMD = true
+ ARM64.HasFP = true
+
+ // Go already assumes these to be available because they were on the M1
+ // and these are supported on all Apple arm64 chips.
+ ARM64.HasAES = true
+ ARM64.HasPMULL = true
+ ARM64.HasSHA1 = true
+ ARM64.HasSHA2 = true
+
+ if runtime.GOOS != "ios" {
+ // Apple A7 processors do not support these, however
+ // M-series SoCs are at least armv8.4-a
+ ARM64.HasCRC32 = true // armv8.1
+ ARM64.HasATOMICS = true // armv8.2
+ ARM64.HasJSCVT = true // armv8.3, if HasFP
+ }
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
index 7f1946780b..05913081ec 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
@@ -9,3 +9,4 @@ package cpu
func getisar0() uint64 { return 0 }
func getisar1() uint64 { return 0 }
func getpfr0() uint64 { return 0 }
+func getzfr0() uint64 { return 0 }
diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
index ff74d7afa8..6c7c5bfd53 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !linux && !netbsd && !openbsd && !windows && arm64
+//go:build !darwin && !linux && !netbsd && !openbsd && !windows && arm64
package cpu
-func doinit() {}
+func doinit() {
+ setMinimalFeatures()
+}
diff --git a/vendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go b/vendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go
new file mode 100644
index 0000000000..7b4e67ff9c
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go
@@ -0,0 +1,54 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Minimal copy from internal/cpu and runtime to make sysctl calls.
+
+//go:build darwin && arm64 && gc
+
+package cpu
+
+import (
+ "syscall"
+ "unsafe"
+)
+
+type Errno = syscall.Errno
+
+// adapted from internal/cpu/cpu_arm64_darwin.go
+func darwinSysctlEnabled(name []byte) bool {
+ out := int32(0)
+ nout := unsafe.Sizeof(out)
+ if ret := sysctlbyname(&name[0], (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); ret != nil {
+ return false
+ }
+ return out > 0
+}
+
+//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
+
+var libc_sysctlbyname_trampoline_addr uintptr
+
+// adapted from runtime/sys_darwin.go in the pattern of sysctl() above, as defined in x/sys/unix
+func sysctlbyname(name *byte, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
+ if _, _, err := syscall_syscall6(
+ libc_sysctlbyname_trampoline_addr,
+ uintptr(unsafe.Pointer(name)),
+ uintptr(unsafe.Pointer(old)),
+ uintptr(unsafe.Pointer(oldlen)),
+ uintptr(unsafe.Pointer(new)),
+ uintptr(newlen),
+ 0,
+ ); err != 0 {
+ return err
+ }
+
+ return nil
+}
+
+//go:cgo_import_dynamic libc_sysctlbyname sysctlbyname "/usr/lib/libSystem.B.dylib"
+
+// Implemented in the runtime package (runtime/sys_darwin.go)
+func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+
+//go:linkname syscall_syscall6 syscall.syscall6
diff --git a/vendor/golang.org/x/sys/plan9/syscall_plan9.go b/vendor/golang.org/x/sys/plan9/syscall_plan9.go
index d079d8116e..761912237f 100644
--- a/vendor/golang.org/x/sys/plan9/syscall_plan9.go
+++ b/vendor/golang.org/x/sys/plan9/syscall_plan9.go
@@ -19,13 +19,7 @@ import (
// A Note is a string describing a process note.
// It implements the os.Signal interface.
-type Note string
-
-func (n Note) Signal() {}
-
-func (n Note) String() string {
- return string(n)
-}
+type Note = syscall.Note
var (
Stdin = 0
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go
index c1a4670171..45476a73c6 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go
@@ -593,110 +593,115 @@ const (
)
const (
- NDA_UNSPEC = 0x0
- NDA_DST = 0x1
- NDA_LLADDR = 0x2
- NDA_CACHEINFO = 0x3
- NDA_PROBES = 0x4
- NDA_VLAN = 0x5
- NDA_PORT = 0x6
- NDA_VNI = 0x7
- NDA_IFINDEX = 0x8
- NDA_MASTER = 0x9
- NDA_LINK_NETNSID = 0xa
- NDA_SRC_VNI = 0xb
- NTF_USE = 0x1
- NTF_SELF = 0x2
- NTF_MASTER = 0x4
- NTF_PROXY = 0x8
- NTF_EXT_LEARNED = 0x10
- NTF_OFFLOADED = 0x20
- NTF_ROUTER = 0x80
- NUD_INCOMPLETE = 0x1
- NUD_REACHABLE = 0x2
- NUD_STALE = 0x4
- NUD_DELAY = 0x8
- NUD_PROBE = 0x10
- NUD_FAILED = 0x20
- NUD_NOARP = 0x40
- NUD_PERMANENT = 0x80
- NUD_NONE = 0x0
- IFA_UNSPEC = 0x0
- IFA_ADDRESS = 0x1
- IFA_LOCAL = 0x2
- IFA_LABEL = 0x3
- IFA_BROADCAST = 0x4
- IFA_ANYCAST = 0x5
- IFA_CACHEINFO = 0x6
- IFA_MULTICAST = 0x7
- IFA_FLAGS = 0x8
- IFA_RT_PRIORITY = 0x9
- IFA_TARGET_NETNSID = 0xa
- IFAL_LABEL = 0x2
- IFAL_ADDRESS = 0x1
- RT_SCOPE_UNIVERSE = 0x0
- RT_SCOPE_SITE = 0xc8
- RT_SCOPE_LINK = 0xfd
- RT_SCOPE_HOST = 0xfe
- RT_SCOPE_NOWHERE = 0xff
- RT_TABLE_UNSPEC = 0x0
- RT_TABLE_COMPAT = 0xfc
- RT_TABLE_DEFAULT = 0xfd
- RT_TABLE_MAIN = 0xfe
- RT_TABLE_LOCAL = 0xff
- RT_TABLE_MAX = 0xffffffff
- RTA_UNSPEC = 0x0
- RTA_DST = 0x1
- RTA_SRC = 0x2
- RTA_IIF = 0x3
- RTA_OIF = 0x4
- RTA_GATEWAY = 0x5
- RTA_PRIORITY = 0x6
- RTA_PREFSRC = 0x7
- RTA_METRICS = 0x8
- RTA_MULTIPATH = 0x9
- RTA_FLOW = 0xb
- RTA_CACHEINFO = 0xc
- RTA_TABLE = 0xf
- RTA_MARK = 0x10
- RTA_MFC_STATS = 0x11
- RTA_VIA = 0x12
- RTA_NEWDST = 0x13
- RTA_PREF = 0x14
- RTA_ENCAP_TYPE = 0x15
- RTA_ENCAP = 0x16
- RTA_EXPIRES = 0x17
- RTA_PAD = 0x18
- RTA_UID = 0x19
- RTA_TTL_PROPAGATE = 0x1a
- RTA_IP_PROTO = 0x1b
- RTA_SPORT = 0x1c
- RTA_DPORT = 0x1d
- RTN_UNSPEC = 0x0
- RTN_UNICAST = 0x1
- RTN_LOCAL = 0x2
- RTN_BROADCAST = 0x3
- RTN_ANYCAST = 0x4
- RTN_MULTICAST = 0x5
- RTN_BLACKHOLE = 0x6
- RTN_UNREACHABLE = 0x7
- RTN_PROHIBIT = 0x8
- RTN_THROW = 0x9
- RTN_NAT = 0xa
- RTN_XRESOLVE = 0xb
- SizeofNlMsghdr = 0x10
- SizeofNlMsgerr = 0x14
- SizeofRtGenmsg = 0x1
- SizeofNlAttr = 0x4
- SizeofRtAttr = 0x4
- SizeofIfInfomsg = 0x10
- SizeofIfAddrmsg = 0x8
- SizeofIfAddrlblmsg = 0xc
- SizeofIfaCacheinfo = 0x10
- SizeofRtMsg = 0xc
- SizeofRtNexthop = 0x8
- SizeofNdUseroptmsg = 0x10
- SizeofNdMsg = 0xc
+ NDA_UNSPEC = 0x0
+ NDA_DST = 0x1
+ NDA_LLADDR = 0x2
+ NDA_CACHEINFO = 0x3
+ NDA_PROBES = 0x4
+ NDA_VLAN = 0x5
+ NDA_PORT = 0x6
+ NDA_VNI = 0x7
+ NDA_IFINDEX = 0x8
+ NDA_MASTER = 0x9
+ NDA_LINK_NETNSID = 0xa
+ NDA_SRC_VNI = 0xb
+ NTF_USE = 0x1
+ NTF_SELF = 0x2
+ NTF_MASTER = 0x4
+ NTF_PROXY = 0x8
+ NTF_EXT_LEARNED = 0x10
+ NTF_OFFLOADED = 0x20
+ NTF_ROUTER = 0x80
+ NUD_INCOMPLETE = 0x1
+ NUD_REACHABLE = 0x2
+ NUD_STALE = 0x4
+ NUD_DELAY = 0x8
+ NUD_PROBE = 0x10
+ NUD_FAILED = 0x20
+ NUD_NOARP = 0x40
+ NUD_PERMANENT = 0x80
+ NUD_NONE = 0x0
+ IFA_UNSPEC = 0x0
+ IFA_ADDRESS = 0x1
+ IFA_LOCAL = 0x2
+ IFA_LABEL = 0x3
+ IFA_BROADCAST = 0x4
+ IFA_ANYCAST = 0x5
+ IFA_CACHEINFO = 0x6
+ IFA_MULTICAST = 0x7
+ IFA_FLAGS = 0x8
+ IFA_RT_PRIORITY = 0x9
+ IFA_TARGET_NETNSID = 0xa
+ IFAL_LABEL = 0x2
+ IFAL_ADDRESS = 0x1
+ RT_SCOPE_UNIVERSE = 0x0
+ RT_SCOPE_SITE = 0xc8
+ RT_SCOPE_LINK = 0xfd
+ RT_SCOPE_HOST = 0xfe
+ RT_SCOPE_NOWHERE = 0xff
+ RT_TABLE_UNSPEC = 0x0
+ RT_TABLE_COMPAT = 0xfc
+ RT_TABLE_DEFAULT = 0xfd
+ RT_TABLE_MAIN = 0xfe
+ RT_TABLE_LOCAL = 0xff
+ RT_TABLE_MAX = 0xffffffff
+ RTA_UNSPEC = 0x0
+ RTA_DST = 0x1
+ RTA_SRC = 0x2
+ RTA_IIF = 0x3
+ RTA_OIF = 0x4
+ RTA_GATEWAY = 0x5
+ RTA_PRIORITY = 0x6
+ RTA_PREFSRC = 0x7
+ RTA_METRICS = 0x8
+ RTA_MULTIPATH = 0x9
+ RTA_FLOW = 0xb
+ RTA_CACHEINFO = 0xc
+ RTA_TABLE = 0xf
+ RTA_MARK = 0x10
+ RTA_MFC_STATS = 0x11
+ RTA_VIA = 0x12
+ RTA_NEWDST = 0x13
+ RTA_PREF = 0x14
+ RTA_ENCAP_TYPE = 0x15
+ RTA_ENCAP = 0x16
+ RTA_EXPIRES = 0x17
+ RTA_PAD = 0x18
+ RTA_UID = 0x19
+ RTA_TTL_PROPAGATE = 0x1a
+ RTA_IP_PROTO = 0x1b
+ RTA_SPORT = 0x1c
+ RTA_DPORT = 0x1d
+ RTN_UNSPEC = 0x0
+ RTN_UNICAST = 0x1
+ RTN_LOCAL = 0x2
+ RTN_BROADCAST = 0x3
+ RTN_ANYCAST = 0x4
+ RTN_MULTICAST = 0x5
+ RTN_BLACKHOLE = 0x6
+ RTN_UNREACHABLE = 0x7
+ RTN_PROHIBIT = 0x8
+ RTN_THROW = 0x9
+ RTN_NAT = 0xa
+ RTN_XRESOLVE = 0xb
+ PREFIX_UNSPEC = 0x0
+ PREFIX_ADDRESS = 0x1
+ PREFIX_CACHEINFO = 0x2
+ SizeofNlMsghdr = 0x10
+ SizeofNlMsgerr = 0x14
+ SizeofRtGenmsg = 0x1
+ SizeofNlAttr = 0x4
+ SizeofRtAttr = 0x4
+ SizeofIfInfomsg = 0x10
+ SizeofPrefixmsg = 0xc
+ SizeofPrefixCacheinfo = 0x8
+ SizeofIfAddrmsg = 0x8
+ SizeofIfAddrlblmsg = 0xc
+ SizeofIfaCacheinfo = 0x10
+ SizeofRtMsg = 0xc
+ SizeofRtNexthop = 0x8
+ SizeofNdUseroptmsg = 0x10
+ SizeofNdMsg = 0xc
)
type NlMsghdr struct {
@@ -735,6 +740,22 @@ type IfInfomsg struct {
Change uint32
}
+type Prefixmsg struct {
+ Family uint8
+ Pad1 uint8
+ Pad2 uint16
+ Ifindex int32
+ Type uint8
+ Len uint8
+ Flags uint8
+ Pad3 uint8
+}
+
+type PrefixCacheinfo struct {
+ Preferred_time uint32
+ Valid_time uint32
+}
+
type IfAddrmsg struct {
Family uint8
Prefixlen uint8
diff --git a/vendor/golang.org/x/sys/windows/aliases.go b/vendor/golang.org/x/sys/windows/aliases.go
index 16f90560a2..96317966e5 100644
--- a/vendor/golang.org/x/sys/windows/aliases.go
+++ b/vendor/golang.org/x/sys/windows/aliases.go
@@ -8,5 +8,6 @@ package windows
import "syscall"
+type Signal = syscall.Signal
type Errno = syscall.Errno
type SysProcAttr = syscall.SysProcAttr
diff --git a/vendor/golang.org/x/sys/windows/registry/key.go b/vendor/golang.org/x/sys/windows/registry/key.go
index 39aeeb644f..7cc6ff3afa 100644
--- a/vendor/golang.org/x/sys/windows/registry/key.go
+++ b/vendor/golang.org/x/sys/windows/registry/key.go
@@ -198,7 +198,20 @@ type KeyInfo struct {
// ModTime returns the key's last write time.
func (ki *KeyInfo) ModTime() time.Time {
- return time.Unix(0, ki.lastWriteTime.Nanoseconds())
+ lastHigh, lastLow := ki.lastWriteTime.HighDateTime, ki.lastWriteTime.LowDateTime
+ // 100-nanosecond intervals since January 1, 1601
+ hsec := uint64(lastHigh)<<32 + uint64(lastLow)
+ // Convert _before_ gauging; the nanosecond difference between Epoch (00:00:00
+ // UTC, January 1, 1970) and Filetime's zero offset (January 1, 1601) is out
+ // of bounds for int64: -11644473600*1e7*1e2 < math.MinInt64
+ sec := int64(hsec/1e7) - 11644473600
+ nsec := int64(hsec%1e7) * 100
+ return time.Unix(sec, nsec)
+}
+
+// modTimeZero reports whether the key's last write time is zero.
+func (ki *KeyInfo) modTimeZero() bool {
+ return ki.lastWriteTime.LowDateTime == 0 && ki.lastWriteTime.HighDateTime == 0
}
// Stat retrieves information about the open key k.
diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go
index 738a9f2121..d766436587 100644
--- a/vendor/golang.org/x/sys/windows/syscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/syscall_windows.go
@@ -1490,20 +1490,6 @@ func Getgid() (gid int) { return -1 }
func Getegid() (egid int) { return -1 }
func Getgroups() (gids []int, err error) { return nil, syscall.EWINDOWS }
-type Signal int
-
-func (s Signal) Signal() {}
-
-func (s Signal) String() string {
- if 0 <= s && int(s) < len(signals) {
- str := signals[s]
- if str != "" {
- return str
- }
- }
- return "signal " + itoa(int(s))
-}
-
func LoadCreateSymbolicLink() error {
return procCreateSymbolicLinkW.Find()
}
diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go
index 680a70ca8f..a6c17cf634 100644
--- a/vendor/golang.org/x/tools/go/packages/golist.go
+++ b/vendor/golang.org/x/tools/go/packages/golist.go
@@ -61,13 +61,42 @@ func (r *responseDeduper) addAll(dr *DriverResponse) {
}
func (r *responseDeduper) addPackage(p *Package) {
- if r.seenPackages[p.ID] != nil {
+ if prev := r.seenPackages[p.ID]; prev != nil {
+ // Package already seen in a previous response. Merge the file lists,
+ // removing duplicates. This can happen when the same package appears
+ // in multiple driver responses that are being merged together.
+ prev.GoFiles = appendUniqueStrings(prev.GoFiles, p.GoFiles)
+ prev.CompiledGoFiles = appendUniqueStrings(prev.CompiledGoFiles, p.CompiledGoFiles)
+ prev.OtherFiles = appendUniqueStrings(prev.OtherFiles, p.OtherFiles)
+ prev.IgnoredFiles = appendUniqueStrings(prev.IgnoredFiles, p.IgnoredFiles)
+ prev.EmbedFiles = appendUniqueStrings(prev.EmbedFiles, p.EmbedFiles)
+ prev.EmbedPatterns = appendUniqueStrings(prev.EmbedPatterns, p.EmbedPatterns)
return
}
r.seenPackages[p.ID] = p
r.dr.Packages = append(r.dr.Packages, p)
}
+// appendUniqueStrings appends elements from src to dst, skipping duplicates.
+func appendUniqueStrings(dst, src []string) []string {
+ if len(src) == 0 {
+ return dst
+ }
+
+ seen := make(map[string]bool, len(dst))
+ for _, s := range dst {
+ seen[s] = true
+ }
+
+ for _, s := range src {
+ if !seen[s] {
+ dst = append(dst, s)
+ }
+ }
+
+ return dst
+}
+
func (r *responseDeduper) addRoot(id string) {
if r.seenRoots[id] {
return
@@ -832,6 +861,8 @@ func golistargs(cfg *Config, words []string, goVersion int) []string {
// go list doesn't let you pass -test and -find together,
// probably because you'd just get the TestMain.
fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0 && !usesExportData(cfg)),
+ // VCS information is not needed when not printing Stale or StaleReason fields
+ "-buildvcs=false",
}
// golang/go#60456: with go1.21 and later, go list serves pgo variants, which
diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go
index b249a5c7ef..412ba06b56 100644
--- a/vendor/golang.org/x/tools/go/packages/packages.go
+++ b/vendor/golang.org/x/tools/go/packages/packages.go
@@ -403,6 +403,10 @@ func mergeResponses(responses ...*DriverResponse) *DriverResponse {
if len(responses) == 0 {
return nil
}
+ // No dedup needed
+ if len(responses) == 1 {
+ return responses[0]
+ }
response := newDeduper()
response.dr.NotHandled = false
response.dr.Compiler = responses[0].Compiler
diff --git a/vendor/modules.txt b/vendor/modules.txt
index f1c1d58937..1ccc2dbe76 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -110,7 +110,7 @@ github.com/davecgh/go-spew/spew
# github.com/distribution/reference v0.6.0
## explicit; go 1.20
github.com/distribution/reference
-# github.com/docker/cli v29.2.1+incompatible
+# github.com/docker/cli v29.3.0+incompatible
## explicit
github.com/docker/cli/cli/config
github.com/docker/cli/cli/config/configfile
@@ -216,8 +216,8 @@ github.com/google/go-cmp/cmp/internal/diff
github.com/google/go-cmp/cmp/internal/flags
github.com/google/go-cmp/cmp/internal/function
github.com/google/go-cmp/cmp/internal/value
-# github.com/google/go-containerregistry v0.21.2
-## explicit; go 1.25.6
+# github.com/google/go-containerregistry v0.21.3
+## explicit; go 1.25.7
github.com/google/go-containerregistry/cmd/crane
github.com/google/go-containerregistry/cmd/crane/cmd
github.com/google/go-containerregistry/internal/and
@@ -446,8 +446,8 @@ github.com/russross/blackfriday/v2
# github.com/sergi/go-diff v1.4.0
## explicit; go 1.13
github.com/sergi/go-diff/diffmatchpatch
-# github.com/sirupsen/logrus v1.9.3
-## explicit; go 1.13
+# github.com/sirupsen/logrus v1.9.4
+## explicit; go 1.17
github.com/sirupsen/logrus
# github.com/spf13/afero v1.12.0
## explicit; go 1.21
@@ -457,7 +457,7 @@ github.com/spf13/afero/mem
# github.com/spf13/cobra v1.10.2
## 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/spyzhov/ajson v0.9.6
@@ -591,8 +591,8 @@ go.yaml.in/yaml/v2
# go.yaml.in/yaml/v3 v3.0.4
## explicit; go 1.16
go.yaml.in/yaml/v3
-# golang.org/x/crypto v0.48.0
-## explicit; go 1.24.0
+# golang.org/x/crypto v0.49.0
+## explicit; go 1.25.0
golang.org/x/crypto/chacha20
golang.org/x/crypto/chacha20poly1305
golang.org/x/crypto/cryptobyte
@@ -608,7 +608,7 @@ golang.org/x/exp/maps
golang.org/x/mod/internal/lazyregexp
golang.org/x/mod/module
golang.org/x/mod/semver
-# golang.org/x/net v0.51.0
+# golang.org/x/net v0.52.0
## explicit; go 1.25.0
golang.org/x/net/context/ctxhttp
golang.org/x/net/http/httpguts
@@ -635,18 +635,18 @@ golang.org/x/oauth2/jwt
## explicit; go 1.25.0
golang.org/x/sync/errgroup
golang.org/x/sync/semaphore
-# golang.org/x/sys v0.41.0
-## explicit; go 1.24.0
+# golang.org/x/sys v0.42.0
+## explicit; go 1.25.0
golang.org/x/sys/cpu
golang.org/x/sys/plan9
golang.org/x/sys/unix
golang.org/x/sys/windows
golang.org/x/sys/windows/registry
-# golang.org/x/term v0.40.0
-## explicit; go 1.24.0
+# golang.org/x/term v0.41.0
+## explicit; go 1.25.0
golang.org/x/term
-# golang.org/x/text v0.34.0
-## explicit; go 1.24.0
+# golang.org/x/text v0.35.0
+## explicit; go 1.25.0
golang.org/x/text/cases
golang.org/x/text/encoding
golang.org/x/text/encoding/internal
@@ -666,8 +666,8 @@ golang.org/x/text/unicode/norm
# golang.org/x/time v0.15.0
## explicit; go 1.25.0
golang.org/x/time/rate
-# golang.org/x/tools v0.42.0
-## explicit; go 1.24.0
+# golang.org/x/tools v0.43.0
+## explicit; go 1.25.0
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/go/ast/edge
golang.org/x/tools/go/ast/inspector
@@ -870,6 +870,8 @@ gopkg.in/yaml.v2
# gopkg.in/yaml.v3 v3.0.1
## explicit
gopkg.in/yaml.v3
+# gotest.tools/v3 v3.5.2
+## explicit; go 1.17
# k8s.io/api v0.35.2
## explicit; go 1.25.0
k8s.io/api/admission/v1