Skip to content

Commit e653222

Browse files
committed
Migrate to distribution/[email protected]
1 parent ea45cd5 commit e653222

File tree

24 files changed

+168
-103
lines changed

24 files changed

+168
-103
lines changed

go.mod

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ require (
1616
github.com/containers/storage v1.58.0
1717
github.com/coreos/go-oidc/v3 v3.14.1
1818
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
19-
github.com/distribution/distribution/v3 v3.0.0-20230519140516-983358f8e250
19+
github.com/distribution/distribution/v3 v3.0.0
20+
github.com/distribution/reference v0.6.0
2021
github.com/docker/docker v25.0.6+incompatible
2122
github.com/docker/go-units v0.5.0
2223
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7
@@ -33,11 +34,12 @@ require (
3334
github.com/moby/sys/sequential v0.5.0
3435
github.com/moby/term v0.5.2
3536
github.com/opencontainers/go-digest v1.0.0
36-
github.com/opencontainers/image-spec v1.1.0
37+
github.com/opencontainers/image-spec v1.1.1
3738
github.com/openshift/api v0.0.0-20250710082954-674ad74beffc
3839
github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c
3940
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee
4041
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea
42+
github.com/openshift/library-go/pkg/image/registryclient/v2 v2.0.0-00010101000000-000000000000
4143
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
4244
github.com/prometheus/client_golang v1.22.0
4345
github.com/russross/blackfriday v1.6.0
@@ -80,8 +82,7 @@ require (
8082
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
8183
github.com/containers/ocicrypt v1.1.9 // indirect
8284
github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f // indirect
83-
github.com/distribution/reference v0.6.0 // indirect
84-
github.com/docker/docker-credential-helpers v0.8.1 // indirect
85+
github.com/docker/docker-credential-helpers v0.8.2 // indirect
8586
github.com/docker/go-connections v0.5.0 // indirect
8687
github.com/docker/go-metrics v0.0.1 // indirect
8788
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
@@ -95,7 +96,7 @@ require (
9596
github.com/go-git/go-billy/v5 v5.6.1 // indirect
9697
github.com/go-git/go-git/v5 v5.13.1 // indirect
9798
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
98-
github.com/go-logr/logr v1.4.2 // indirect
99+
github.com/go-logr/logr v1.4.3 // indirect
99100
github.com/go-openapi/analysis v0.21.4 // indirect
100101
github.com/go-openapi/errors v0.21.1 // indirect
101102
github.com/go-openapi/jsonpointer v0.21.0 // indirect
@@ -125,7 +126,8 @@ require (
125126
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
126127
github.com/hashicorp/errwrap v1.1.0 // indirect
127128
github.com/hashicorp/go-multierror v1.1.1 // indirect
128-
github.com/hashicorp/golang-lru v1.0.2 // indirect
129+
github.com/hashicorp/golang-lru/arc/v2 v2.0.7 // indirect
130+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
129131
github.com/inconshreveable/mousetrap v1.1.0 // indirect
130132
github.com/int128/listener v1.2.0 // indirect
131133
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
@@ -161,9 +163,9 @@ require (
161163
github.com/pkg/profile v1.7.0 // indirect
162164
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
163165
github.com/proglottis/gpgme v0.1.3 // indirect
164-
github.com/prometheus/client_model v0.6.1 // indirect
165-
github.com/prometheus/common v0.62.0 // indirect
166-
github.com/prometheus/procfs v0.15.1 // indirect
166+
github.com/prometheus/client_model v0.6.2 // indirect
167+
github.com/prometheus/common v0.65.0 // indirect
168+
github.com/prometheus/procfs v0.17.0 // indirect
167169
github.com/robfig/cron v1.2.0 // indirect
168170
github.com/russross/blackfriday/v2 v2.1.0 // indirect
169171
github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect
@@ -184,9 +186,9 @@ require (
184186
go.yaml.in/yaml/v3 v3.0.4 // indirect
185187
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
186188
golang.org/x/text v0.27.0 // indirect
187-
golang.org/x/time v0.9.0 // indirect
189+
golang.org/x/time v0.12.0 // indirect
188190
golang.org/x/tools v0.34.0 // indirect
189-
google.golang.org/protobuf v1.36.5 // indirect
191+
google.golang.org/protobuf v1.36.6 // indirect
190192
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
191193
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
192194
gopkg.in/inf.v0 v0.9.1 // indirect
@@ -207,3 +209,5 @@ require (
207209
)
208210

209211
replace github.com/apcera/gssapi => github.com/openshift/gssapi v0.0.0-20161010215902-5fb4217df13b
212+
213+
replace github.com/openshift/library-go/pkg/image/registryclient/v2 => github.com/tchap/library-go/pkg/image/registryclient/v2 v2.0.0-20250722083015-8716d02a8a94

go.sum

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
8686
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8787
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
8888
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
89-
github.com/distribution/distribution/v3 v3.0.0-20230519140516-983358f8e250 h1:B3eXeuNArF23dRKyO8RXRiL7YAJDus6B7bjXeYPt87k=
90-
github.com/distribution/distribution/v3 v3.0.0-20230519140516-983358f8e250/go.mod h1:t1IxPNGdTGez+YGKyJyQrtSSqisfMIm1hnFhvMPlxtE=
89+
github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM=
90+
github.com/distribution/distribution/v3 v3.0.0/go.mod h1:tRNuFoZsUdyRVegq8xGNeds4KLjwLCRin/tTo6i1DhU=
9191
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
9292
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
9393
github.com/docker/cli v25.0.3+incompatible h1:KLeNs7zws74oFuVhgZQ5ONGZiXUUdgsdy6/EsX/6284=
@@ -96,8 +96,8 @@ github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBi
9696
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
9797
github.com/docker/docker v25.0.6+incompatible h1:5cPwbwriIcsua2REJe8HqQV+6WlWc1byg2QSXzBxBGg=
9898
github.com/docker/docker v25.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
99-
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
100-
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
99+
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
100+
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
101101
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
102102
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
103103
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
@@ -142,8 +142,8 @@ github.com/go-ldap/ldap/v3 v3.4.3 h1:JCKUtJPIcyOuG7ctGabLKMgIlKnGumD/iGjuWeEruDI
142142
github.com/go-ldap/ldap/v3 v3.4.3/go.mod h1:7LdHfVt6iIOESVEe3Bs4Jp2sHEKgDeduAhgM1/f9qmo=
143143
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
144144
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
145-
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
146-
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
145+
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
146+
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
147147
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
148148
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
149149
github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY=
@@ -273,8 +273,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
273273
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
274274
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
275275
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
276-
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
277-
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
276+
github.com/hashicorp/golang-lru/arc/v2 v2.0.7 h1:QxkVTxwColcduO+LP7eJO56r2hFiG8zEbfAAzRv52KQ=
277+
github.com/hashicorp/golang-lru/arc/v2 v2.0.7/go.mod h1:Pe7gBlGdc8clY5LJ0LpJXMt5AmgmWNH1g+oFFVUHOEc=
278+
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
279+
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
278280
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
279281
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
280282
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
@@ -389,8 +391,8 @@ github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
389391
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
390392
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
391393
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
392-
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
393-
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
394+
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
395+
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
394396
github.com/opencontainers/runc v1.1.13 h1:98S2srgG9vw0zWcDpFMn5TRrh8kLxa/5OFUstuUhmRs=
395397
github.com/opencontainers/runc v1.1.13/go.mod h1:R016aXacfp/gwQBYw2FDGa9m+n6atbLWrYY8hNMT/sA=
396398
github.com/opencontainers/runtime-spec v1.2.1 h1:S4k4ryNgEpxW1dzyqffOmhI1BHYcjzU8lpJfSlR0xww=
@@ -431,17 +433,17 @@ github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/
431433
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
432434
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
433435
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
434-
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
435-
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
436+
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
437+
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
436438
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
437439
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
438-
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
439-
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
440+
github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE=
441+
github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
440442
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
441443
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
442444
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
443-
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
444-
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
445+
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
446+
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
445447
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
446448
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
447449
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
@@ -492,6 +494,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
492494
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
493495
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
494496
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
497+
github.com/tchap/library-go/pkg/image/registryclient/v2 v2.0.0-20250722083015-8716d02a8a94 h1:J+xbf7C4qRwU1vo+FS+kb5AZhCM/xtBIF+Fg4MQuyOY=
498+
github.com/tchap/library-go/pkg/image/registryclient/v2 v2.0.0-20250722083015-8716d02a8a94/go.mod h1:yK17k8WxKQLWp5d8KkcLL0VWrNSFfdC521IPhdmwDIo=
495499
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
496500
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0=
497501
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs=
@@ -611,8 +615,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
611615
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
612616
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
613617
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
614-
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
615-
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
618+
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
619+
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
616620
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
617621
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
618622
golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
@@ -628,13 +632,13 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
628632
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
629633
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
630634
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
631-
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
635+
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU=
632636
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY=
633637
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
634638
google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0=
635639
google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw=
636-
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
637-
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
640+
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
641+
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
638642
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
639643
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
640644
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package distributionopts
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/distribution/distribution/v3"
7+
"github.com/distribution/reference"
8+
)
9+
10+
type optionFunc func(interface{}) error
11+
12+
func (f optionFunc) Apply(v interface{}) error {
13+
return f(v)
14+
}
15+
16+
// WithDescriptor returns a BlobCreateOption which provides the expected blob metadata.
17+
func WithDescriptor(desc distribution.Descriptor) distribution.BlobCreateOption {
18+
return optionFunc(func(v interface{}) error {
19+
opts, ok := v.(*distribution.CreateOptions)
20+
if !ok {
21+
return fmt.Errorf("unexpected options type: %T", v)
22+
}
23+
if opts.Mount.Stat == nil {
24+
opts.Mount.Stat = &desc
25+
}
26+
return nil
27+
})
28+
}
29+
30+
// WithMountFrom returns a BlobCreateOption which designates that the blob should be
31+
// mounted from the given canonical reference.
32+
func WithMountFrom(ref reference.Canonical) distribution.BlobCreateOption {
33+
return optionFunc(func(v interface{}) error {
34+
opts, ok := v.(*distribution.CreateOptions)
35+
if !ok {
36+
return fmt.Errorf("unexpected options type: %T", v)
37+
}
38+
39+
opts.Mount.ShouldMount = true
40+
opts.Mount.From = ref
41+
42+
return nil
43+
})
44+
}

pkg/cli/admin/verifyimagesignature/manifest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"k8s.io/client-go/rest"
1111

12-
"github.com/openshift/library-go/pkg/image/registryclient"
12+
"github.com/openshift/library-go/pkg/image/registryclient/v2"
1313
)
1414

1515
// getImageManifestByIDFromRegistry retrieves the image manifest from the registry using the basic

pkg/cli/image/append/append.go

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import (
1616
"github.com/distribution/distribution/v3"
1717
"github.com/distribution/distribution/v3/manifest/manifestlist"
1818
"github.com/distribution/distribution/v3/manifest/schema2"
19-
"github.com/distribution/distribution/v3/reference"
20-
"github.com/distribution/distribution/v3/registry/client"
19+
"github.com/distribution/reference"
2120
units "github.com/docker/go-units"
2221
digest "github.com/opencontainers/go-digest"
2322

@@ -27,7 +26,8 @@ import (
2726

2827
"github.com/openshift/api/image/docker10"
2928
"github.com/openshift/library-go/pkg/image/dockerv1client"
30-
"github.com/openshift/library-go/pkg/image/registryclient"
29+
"github.com/openshift/library-go/pkg/image/registryclient/v2"
30+
"github.com/openshift/oc/internal/distributionopts"
3131
"github.com/openshift/oc/pkg/cli/image/imagesource"
3232
imagemanifest "github.com/openshift/oc/pkg/cli/image/manifest"
3333
"github.com/openshift/oc/pkg/cli/image/workqueue"
@@ -587,13 +587,13 @@ func copyBlob(ctx context.Context, fromBlobs, toBlobs distribution.BlobService,
587587
defer r.Close()
588588

589589
// destination
590-
mountOptions := []distribution.BlobCreateOption{WithDescriptor(layer)}
590+
mountOptions := []distribution.BlobCreateOption{distributionopts.WithDescriptor(layer)}
591591
if mountFrom != nil && !needLayerDigest {
592592
source, err := reference.WithDigest(mountFrom, layer.Digest)
593593
if err != nil {
594594
return distribution.Descriptor{}, "", err
595595
}
596-
mountOptions = append(mountOptions, client.WithMountFrom(source))
596+
mountOptions = append(mountOptions, distributionopts.WithMountFrom(source))
597597
}
598598
bw, err := toBlobs.Create(ctx, mountOptions...)
599599
if err != nil {
@@ -644,26 +644,6 @@ func copyBlob(ctx context.Context, fromBlobs, toBlobs distribution.BlobService,
644644
return desc, layerDigest, nil
645645
}
646646

647-
type optionFunc func(interface{}) error
648-
649-
func (f optionFunc) Apply(v interface{}) error {
650-
return f(v)
651-
}
652-
653-
// WithDescriptor returns a BlobCreateOption which provides the expected blob metadata.
654-
func WithDescriptor(desc distribution.Descriptor) distribution.BlobCreateOption {
655-
return optionFunc(func(v interface{}) error {
656-
opts, ok := v.(*distribution.CreateOptions)
657-
if !ok {
658-
return fmt.Errorf("unexpected options type: %T", v)
659-
}
660-
if opts.Mount.Stat == nil {
661-
opts.Mount.Stat = &desc
662-
}
663-
return nil
664-
})
665-
}
666-
667647
func appendFileAsLayer(ctx context.Context, name string, layers []distribution.Descriptor, config *dockerv1client.DockerImageConfig, dryRun bool, out io.Writer,
668648
blobs distribution.BlobService) ([]distribution.Descriptor, error) {
669649
f, err := os.Open(name)

pkg/cli/image/append/dryrun.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/distribution/distribution/v3"
1111
digest "github.com/opencontainers/go-digest"
1212

13-
"github.com/openshift/library-go/pkg/image/registryclient"
13+
"github.com/openshift/library-go/pkg/image/registryclient/v2"
1414
)
1515

1616
// dryRunManifestService emulates a remote registry for dry run behavior

0 commit comments

Comments
 (0)