Skip to content

Commit fe7190e

Browse files
author
Domenico Luciani
committed
Bumped up to the imgutil latest version with the insecure adjustment and renamed the getInsecureRegistryOptions function
Signed-off-by: Domenico Luciani <[email protected]>
1 parent 4c47cbc commit fe7190e

9 files changed

+33
-17
lines changed

cmd/lifecycle/exporter.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ func (e *exportCmd) initRemoteAppImage(analyzedMD files.Analyzed) (imgutil.Image
357357
opts = append(opts, remote.WithHistory())
358358
}
359359

360-
opts = append(opts, e.getInsecureRegistryOptions(e.RunImageRef)...)
360+
opts = append(opts, e.getInsecureOptions(e.RunImageRef)...)
361361

362362
if analyzedMD.PreviousImageRef() != "" {
363363
cmd.DefaultLogger.Infof("Reusing layers from image '%s'", analyzedMD.PreviousImageRef())
@@ -525,13 +525,13 @@ func (e *exportCmd) hasExtendedLayers() bool {
525525
return true
526526
}
527527

528-
func (e *exportCmd) getInsecureRegistryOptions(imageRef string) []remote.ImageOption {
528+
func (e *exportCmd) getInsecureOptions(imageRef string) []remote.ImageOption {
529529
var opts []remote.ImageOption
530530
if len(e.InsecureRegistries) > 0 {
531531
cmd.DefaultLogger.Warnf("Found Insecure Registries: %+q", e.InsecureRegistries)
532532
for _, insecureRegistry := range e.InsecureRegistries {
533533
if strings.HasPrefix(imageRef, insecureRegistry) {
534-
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true, true))
534+
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true))
535535
}
536536
}
537537
}

cmd/lifecycle/rebaser.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (r *rebaseCmd) getInsecureRegistryOptions(imageRef string) []remote.ImageOp
217217
cmd.DefaultLogger.Warnf("Found Insecure Registries: %+q", r.InsecureRegistries)
218218
for _, insecureRegistry := range r.InsecureRegistries {
219219
if strings.HasPrefix(imageRef, insecureRegistry) {
220-
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true, true))
220+
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true))
221221
}
222222
}
223223
}

cmd/lifecycle/restorer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func (r *restoreCmd) getInsecureRegistryOptions(imageRef string) []remote.ImageO
297297
cmd.DefaultLogger.Warnf("Found Insecure Registries: %+q", r.InsecureRegistries)
298298
for _, insecureRegistry := range r.InsecureRegistries {
299299
if strings.HasPrefix(imageRef, insecureRegistry) {
300-
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true, true))
300+
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true))
301301
}
302302
}
303303
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require (
55
github.com/GoogleContainerTools/kaniko v1.13.0
66
github.com/apex/log v1.9.0
77
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230522190001-adf1bafd791a
8-
github.com/buildpacks/imgutil v0.0.0-20230802154001-5c57feb120b3
8+
github.com/buildpacks/imgutil v0.0.0-20230908131741-6a790d131d36
99
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589
1010
github.com/containerd/containerd v1.7.2
1111
github.com/docker/docker v24.0.2+incompatible

go.sum

+16
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
137137
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
138138
github.com/buildpacks/imgutil v0.0.0-20230802154001-5c57feb120b3 h1:9eEu535RJ4PzL3wfaHMD6w9nXifI/CnRZis57vMo/es=
139139
github.com/buildpacks/imgutil v0.0.0-20230802154001-5c57feb120b3/go.mod h1:mBG5M3GJW5nknCEOOqtmMHyPYnSpw/5GEiciuYU/COw=
140+
github.com/buildpacks/imgutil v0.0.0-20230908131741-6a790d131d36 h1:a1fCRKKJPZnPgPmJIRMYDQRaDf9v9X4wknZY4NYFH2E=
141+
github.com/buildpacks/imgutil v0.0.0-20230908131741-6a790d131d36/go.mod h1:mBG5M3GJW5nknCEOOqtmMHyPYnSpw/5GEiciuYU/COw=
140142
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
141143
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
142144
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
145+
github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E=
143146
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 h1:krfRl01rzPzxSxyLyrChD+U+MzsBXbm0OwYYB67uF+4=
144147
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589/go.mod h1:OuDyvmLnMCwa2ep4Jkm6nyA0ocJuZlGyk2gGseVzERM=
145148
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
@@ -153,6 +156,7 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht
153156
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
154157
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
155158
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
159+
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
156160
github.com/containerd/containerd v1.7.1 h1:k8DbDkSOwt5rgxQ3uCI4WMKIJxIndSCBUaGm5oRn+Go=
157161
github.com/containerd/containerd v1.7.1/go.mod h1:gA+nJUADRBm98QS5j5RPROnt0POQSMK+r7P7EGMC/Qc=
158162
github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU=
@@ -167,6 +171,7 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8
167171
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
168172
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
169173
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
174+
github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
170175
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
171176
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
172177
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -206,6 +211,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2
206211
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
207212
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
208213
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
214+
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
209215
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
210216
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
211217
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
@@ -286,6 +292,7 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
286292
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
287293
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
288294
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
295+
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
289296
github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
290297
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
291298
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
@@ -308,11 +315,14 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW
308315
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
309316
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
310317
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0=
318+
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
311319
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
312320
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
321+
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
313322
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
314323
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
315324
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
325+
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
316326
github.com/karrick/godirwalk v1.17.0 h1:b4kY7nqDdioR/6qnbHQyDvmA17u5G1cZ6J+CZXwSWoI=
317327
github.com/karrick/godirwalk v1.17.0/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
318328
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
@@ -369,9 +379,12 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
369379
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
370380
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
371381
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
382+
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
372383
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
373384
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
385+
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
374386
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
387+
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
375388
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
376389
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
377390
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
@@ -421,7 +434,9 @@ github.com/rootless-containers/rootlesskit v1.1.1/go.mod h1:UD5GoA3dqKCJrnvnhVgQ
421434
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
422435
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
423436
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
437+
github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
424438
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
439+
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
425440
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
426441
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
427442
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
@@ -447,6 +462,7 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
447462
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
448463
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
449464
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
465+
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
450466
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
451467
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
452468
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=

image/registry_handler.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func NewRegistryHandler(keychain authn.Keychain, insecureRegistries []string) *D
3535
// EnsureReadAccess ensures that we can read from the registry
3636
func (rv *DefaultRegistryHandler) EnsureReadAccess(imageRefs ...string) error {
3737
for _, imageRef := range imageRefs {
38-
if err := verifyReadAccess(imageRef, rv.keychain, rv.GetInsecureRegistryOptions(imageRef)); err != nil {
38+
if err := verifyReadAccess(imageRef, rv.keychain, rv.GetInsecureOptions(imageRef)); err != nil {
3939
return err
4040
}
4141
}
@@ -45,20 +45,20 @@ func (rv *DefaultRegistryHandler) EnsureReadAccess(imageRefs ...string) error {
4545
// EnsureWriteAccess ensures that we can write to the registry
4646
func (rv *DefaultRegistryHandler) EnsureWriteAccess(imageRefs ...string) error {
4747
for _, imageRef := range imageRefs {
48-
if err := verifyReadWriteAccess(imageRef, rv.keychain, rv.GetInsecureRegistryOptions(imageRef)); err != nil {
48+
if err := verifyReadWriteAccess(imageRef, rv.keychain, rv.GetInsecureOptions(imageRef)); err != nil {
4949
return err
5050
}
5151
}
5252
return nil
5353
}
5454

55-
// GetInsecureRegistryOptions returns a list of WithRegistrySetting imageOptions matching the specified imageRef prefix
56-
func (rv *DefaultRegistryHandler) GetInsecureRegistryOptions(imageRef string) []remote.ImageOption {
55+
// GetInsecureOptions returns a list of WithRegistrySetting imageOptions matching the specified imageRef prefix
56+
func (rv *DefaultRegistryHandler) GetInsecureOptions(imageRef string) []remote.ImageOption {
5757
var opts []remote.ImageOption
5858
if len(rv.insecureRegistry) > 0 {
5959
for _, insecureRegistry := range rv.insecureRegistry {
6060
if strings.HasPrefix(imageRef, insecureRegistry) {
61-
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true, true))
61+
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true))
6262
}
6363
}
6464
}

image/registry_handler_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,31 @@ func testRegistryHandler(t *testing.T, when spec.G, it spec.S) {
3131
it("returns WithRegistrySetting options for the domains specified", func() {
3232
registryHandler := NewRegistryHandler(mockKeychain, []string{"host.docker.internal"})
3333

34-
registryOptions := registryHandler.GetInsecureRegistryOptions("host.docker.internal/bar")
34+
registryOptions := registryHandler.GetInsecureOptions("host.docker.internal/bar")
3535

3636
h.AssertEq(t, len(registryOptions), 1)
3737
})
3838

3939
it("returns WithRegistrySetting options only for the domains specified", func() {
4040
registryHandler := NewRegistryHandler(mockKeychain, []string{"host.docker.internal", "this.is.just.a.try"})
4141

42-
registryOptions := registryHandler.GetInsecureRegistryOptions("host.docker.internal/bar")
42+
registryOptions := registryHandler.GetInsecureOptions("host.docker.internal/bar")
4343

4444
h.AssertEq(t, len(registryOptions), 1)
4545
})
4646

4747
it("returns empty options if any domain hasn't been specified and the imageRef is empty", func() {
4848
registryHandler := NewRegistryHandler(mockKeychain, nil)
4949

50-
options := registryHandler.GetInsecureRegistryOptions("")
50+
options := registryHandler.GetInsecureOptions("")
5151

5252
h.AssertEq(t, len(options), 0)
5353
})
5454

5555
it("returns empty options if an empty list of insecure registries has been passed but the imageRef has been passed anyway", func() {
5656
registryHandler := NewRegistryHandler(mockKeychain, []string{})
5757

58-
options := registryHandler.GetInsecureRegistryOptions("host.docker.container")
58+
options := registryHandler.GetInsecureOptions("host.docker.container")
5959

6060
h.AssertEq(t, len(options), 0)
6161
})

image/remote_handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (h *RemoteHandler) getInsecureRegistryOptions(imageRef string) []remote.Ima
4444
cmd.DefaultLogger.Warnf("Found Insecure Registries: %+q", h.insecureRegistries)
4545
for _, insecureRegistry := range h.insecureRegistries {
4646
if strings.HasPrefix(imageRef, insecureRegistry) {
47-
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true, true))
47+
opts = append(opts, remote.WithRegistrySetting(insecureRegistry, true))
4848
}
4949
}
5050
}

platform/defaults.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const (
5656
// via a credential helper, or via the `CNB_REGISTRY_AUTH` environment variable. See [auth.DefaultKeychain] for further information.
5757
const EnvUseDaemon = "CNB_USE_DAEMON"
5858

59-
// EnvInsecureRegistries configures the lifecycle to export the application to a remote "insecure" registry
59+
// EnvInsecureRegistries configures the lifecycle to export the application to a remote "insecure" registry.
6060
const EnvInsecureRegistries = "CNB_INSECURE_REGISTRIES"
6161

6262
// ## Provided to handle inputs and outputs in OCI layout format

0 commit comments

Comments
 (0)