From d3473296e21e78cce8cde87e0919013998e7bc0c Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Sun, 12 Jan 2025 19:41:46 +0000 Subject: [PATCH 1/9] Bumped easy wins and swapped to distribution/reference Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- cmd/cnab-to-oci/fixup.go | 2 +- cmd/cnab-to-oci/pull.go | 2 +- cmd/cnab-to-oci/push.go | 2 +- converter/convert.go | 2 +- converter/convert_test.go | 4 +- go.mod | 48 ++++++++++---------- go.sum | 93 ++++++++++++++++++++------------------- remotes/fixup.go | 2 +- remotes/fixup_test.go | 2 +- remotes/fixupevent.go | 2 +- remotes/fixuphelpers.go | 2 +- remotes/fixupoptions.go | 2 +- remotes/mount.go | 2 +- remotes/mount_test.go | 2 +- remotes/pull.go | 2 +- remotes/pull_test.go | 2 +- remotes/push.go | 2 +- remotes/push_test.go | 2 +- remotes/resolver.go | 2 +- 19 files changed, 89 insertions(+), 88 deletions(-) diff --git a/cmd/cnab-to-oci/fixup.go b/cmd/cnab-to-oci/fixup.go index eedecd2..bb70915 100644 --- a/cmd/cnab-to-oci/fixup.go +++ b/cmd/cnab-to-oci/fixup.go @@ -8,8 +8,8 @@ import ( "github.com/cnabio/cnab-go/bundle" "github.com/cnabio/cnab-to-oci/remotes" containerdRemotes "github.com/containerd/containerd/remotes" + "github.com/distribution/reference" "github.com/docker/cli/cli/config" - "github.com/docker/distribution/reference" "github.com/spf13/cobra" ) diff --git a/cmd/cnab-to-oci/pull.go b/cmd/cnab-to-oci/pull.go index d3df1fc..b41d4ab 100644 --- a/cmd/cnab-to-oci/pull.go +++ b/cmd/cnab-to-oci/pull.go @@ -8,7 +8,7 @@ import ( "github.com/cnabio/cnab-to-oci/remotes" "github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" "github.com/spf13/cobra" ) diff --git a/cmd/cnab-to-oci/push.go b/cmd/cnab-to-oci/push.go index 71d88e5..683808b 100644 --- a/cmd/cnab-to-oci/push.go +++ b/cmd/cnab-to-oci/push.go @@ -9,7 +9,7 @@ import ( "github.com/cnabio/cnab-go/bundle" "github.com/cnabio/cnab-to-oci/remotes" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" "github.com/docker/docker/client" "github.com/spf13/cobra" ) diff --git a/converter/convert.go b/converter/convert.go index 055178e..d76f7b7 100644 --- a/converter/convert.go +++ b/converter/convert.go @@ -10,7 +10,7 @@ import ( "github.com/cnabio/cnab-go/bundle" "github.com/cnabio/cnab-to-oci/relocation" "github.com/containerd/containerd/images" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" ocischema "github.com/opencontainers/image-spec/specs-go" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/converter/convert_test.go b/converter/convert_test.go index 17f6bb1..b42eef6 100644 --- a/converter/convert_test.go +++ b/converter/convert_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/cnabio/cnab-to-oci/tests" + "github.com/distribution/reference" "github.com/docker/distribution/manifest/schema2" - "github.com/docker/distribution/reference" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" ) @@ -80,7 +80,7 @@ func TestConvertFromFixedUpBundleToOCI(t *testing.T) { badRelocationMap["my.registry/namespace/my-app-invoc"] = "Some/iNvalid/Ref" _, err = ConvertBundleToOCIIndex(src, named, bundleConfigDescriptor, badRelocationMap) assert.ErrorContains(t, err, "invalid invocation image: "+ - "image \"Some/iNvalid/Ref\" is not a valid image reference: invalid reference format: repository name must be lowercase") + "image \"Some/iNvalid/Ref\" is not a valid image reference: invalid reference format: repository name (iNvalid/Ref) must be lowercase") // Invalid size src = tests.MakeTestBundle() diff --git a/go.mod b/go.mod index 5f73d0e..b05f9c4 100644 --- a/go.mod +++ b/go.mod @@ -6,35 +6,32 @@ toolchain go1.23.3 require ( github.com/cnabio/cnab-go v0.25.2 - github.com/containerd/containerd v1.7.23 - github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f + github.com/containerd/containerd v1.7.25 + github.com/containerd/log v0.1.0 + github.com/containerd/platforms v0.2.1 + github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 + github.com/distribution/reference v0.6.1-0.20240718132515-8c942b0459df + github.com/docker/cli v27.4.1+incompatible + github.com/docker/distribution v2.8.3+incompatible + github.com/docker/docker v27.4.1+incompatible github.com/hashicorp/go-multierror v1.1.1 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.1 - golang.org/x/sync v0.9.0 + golang.org/x/sync v0.10.0 gotest.tools/v3 v3.5.1 ) -require ( - github.com/docker/cli v27.3.1+incompatible - github.com/docker/distribution v2.8.2+incompatible - github.com/docker/docker v27.3.1+incompatible -) - require ( github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect + github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Microsoft/hcsshim v0.12.9 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/errdefs v1.0.0 // indirect - github.com/containerd/log v0.1.0 // indirect - github.com/containerd/platforms v0.2.1 // indirect - github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-metrics v0.0.1 // indirect @@ -50,28 +47,29 @@ require ( github.com/klauspost/compress v1.17.11 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/locker v1.0.1 // indirect - github.com/moby/term v0.5.0 // indirect + github.com/moby/term v0.5.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.60.1 // indirect + github.com/prometheus/common v0.61.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/qri-io/jsonpointer v0.1.1 // indirect github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e // indirect - github.com/sergi/go-diff v1.1.0 // indirect + github.com/sergi/go-diff v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 // indirect - go.opentelemetry.io/otel v1.32.0 // indirect - go.opentelemetry.io/otel/metric v1.32.0 // indirect - go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect - google.golang.org/grpc v1.68.0 // indirect - google.golang.org/protobuf v1.35.1 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect + go.opentelemetry.io/otel v1.33.0 // indirect + go.opentelemetry.io/otel/metric v1.33.0 // indirect + go.opentelemetry.io/otel/trace v1.33.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect + google.golang.org/grpc v1.69.2 // indirect + google.golang.org/protobuf v1.36.2 // indirect ) diff --git a/go.sum b/go.sum index 1530807..f61d742 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= @@ -24,10 +24,10 @@ github.com/cnabio/cnab-go v0.25.2/go.mod h1:nB1VbiyH9kIQv+5zAC/Y6dpsrsvgNzq2CH55 github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups/v3 v3.0.3 h1:S5ByHZ/h9PMe5IOQoN7E+nMc2UcLEM/V48DGDJ9kip0= github.com/containerd/cgroups/v3 v3.0.3/go.mod h1:8HBe7V3aWGLFPd/k03swSIsGjZhHI2WzJmticMgVuz0= -github.com/containerd/containerd v1.7.23 h1:H2CClyUkmpKAGlhQp95g2WXHfLYc7whAuvZGBNYOOwQ= -github.com/containerd/containerd v1.7.23/go.mod h1:7QUzfURqZWCZV7RLNEn1XjUCQLEf0bkaK4GjUaZehxw= -github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= -github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/containerd v1.7.25 h1:khEQOAXOEJalRO228yzVsuASLH42vT7DIo9Ss+9SMFQ= +github.com/containerd/containerd v1.7.25/go.mod h1:tWfHzVI0azhw4CT2vaIjsb2CoV4LJ9PrMPaULAr21Ok= +github.com/containerd/continuity v0.4.4 h1:/fNVfTJ7wIl/YPMHjf+5H32uFhl63JucB34PlCpMKII= +github.com/containerd/continuity v0.4.4/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= @@ -42,20 +42,22 @@ github.com/containerd/typeurl/v2 v2.2.0/go.mod h1:8XOOxnyatxSWuG8OfsZXVnAF4iZfed github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f h1:eHnXnuK47UlSTOQexbzxAZfekVz6i+LKRdj1CU5DPaM= -github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= +github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 h1:uX1JmpONuD549D73r6cgnxyUu18Zb7yHAy5AYU0Pm4Q= +github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= 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 v27.3.1+incompatible h1:qEGdFBF3Xu6SCvCYhc7CzaQTlBmqDuzxPDpigSyeKQQ= -github.com/docker/cli v27.3.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= -github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/distribution/reference v0.6.1-0.20240718132515-8c942b0459df h1:5dsN0RDoKdzqhxBIJ/fJxZGAtcAbkCd6FUPtkao6ROM= +github.com/distribution/reference v0.6.1-0.20240718132515-8c942b0459df/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v27.4.1+incompatible h1:VzPiUlRJ/xh+otB75gva3r05isHMo5wXDfPRi5/b4hI= +github.com/docker/cli v27.4.1+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 v27.4.1+incompatible h1:ZJvcY7gfwHn1JF48PfbyXg7Jyt9ZCWDW+GGXOIxEwp4= +github.com/docker/docker v27.4.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -127,8 +129,8 @@ github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vyg github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= -github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= -github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -159,8 +161,8 @@ github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= -github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= +github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= +github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -172,8 +174,8 @@ github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e h1:gqHzseevuZP github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e/go.mod h1:g7DPkiOsK1xv6T/Ao5scXRkd+yTFygcANPBaaqW+VrI= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -187,8 +189,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -200,20 +202,22 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= -go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= -go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= +go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 h1:K0XaT3DwHAcV4nKLzcQvwAgSyisUghWoY20I7huthMk= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0/go.mod h1:B5Ki776z/MBnVha1Nzwp5arlzBbE3+1jk+pGmaP5HME= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= -go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= -go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= +go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= -go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= -go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= +go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= +go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -228,15 +232,15 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -245,12 +249,12 @@ golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -264,18 +268,17 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 h1:fVoAXEKA4+yufmbdVYv+SE73+cPZbbbe8paLsHfkK+U= google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53/go.mod h1:riSXTwQ4+nqmPGtobMFyW5FqVAmIs0St6VPp4Ug7CE4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f h1:C1QccEa9kUwvMgEUORqQD9S17QesQijxjZ84sO82mfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= -google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= -google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1:3UsHvIr4Wc2aW4brOaSCmcxh9ksica6fHEr8P1XhkYw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= +google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= +google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= +google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 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= diff --git a/remotes/fixup.go b/remotes/fixup.go index 5140798..2b06657 100644 --- a/remotes/fixup.go +++ b/remotes/fixup.go @@ -12,7 +12,7 @@ import ( "github.com/containerd/containerd/remotes" "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" "github.com/hashicorp/go-multierror" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/fixup_test.go b/remotes/fixup_test.go index e4e0c64..95d916c 100644 --- a/remotes/fixup_test.go +++ b/remotes/fixup_test.go @@ -12,7 +12,7 @@ import ( "github.com/cnabio/cnab-to-oci/relocation" "github.com/containerd/containerd/images" "github.com/containerd/containerd/platforms" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" "github.com/opencontainers/go-digest" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" diff --git a/remotes/fixupevent.go b/remotes/fixupevent.go index 27974e0..dc6cfce 100644 --- a/remotes/fixupevent.go +++ b/remotes/fixupevent.go @@ -3,7 +3,7 @@ package remotes import ( "sync" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/fixuphelpers.go b/remotes/fixuphelpers.go index 1ce321a..261f0ca 100644 --- a/remotes/fixuphelpers.go +++ b/remotes/fixuphelpers.go @@ -9,7 +9,7 @@ import ( "github.com/cnabio/cnab-go/bundle" "github.com/containerd/containerd/images" "github.com/containerd/containerd/remotes" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" "github.com/opencontainers/go-digest" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/fixupoptions.go b/remotes/fixupoptions.go index 56005aa..0607937 100644 --- a/remotes/fixupoptions.go +++ b/remotes/fixupoptions.go @@ -9,7 +9,7 @@ import ( "github.com/cnabio/cnab-to-oci/relocation" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/mount.go b/remotes/mount.go index fd12193..917b263 100644 --- a/remotes/mount.go +++ b/remotes/mount.go @@ -11,7 +11,7 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/remotes" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" "github.com/opencontainers/go-digest" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/mount_test.go b/remotes/mount_test.go index d057dd8..05d6120 100644 --- a/remotes/mount_test.go +++ b/remotes/mount_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/containerd/containerd/remotes/docker" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" ) diff --git a/remotes/pull.go b/remotes/pull.go index 1a9c610..fe65e19 100644 --- a/remotes/pull.go +++ b/remotes/pull.go @@ -14,8 +14,8 @@ import ( "github.com/containerd/containerd/images" "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/distribution/reference" "github.com/docker/cli/opts" - "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client/auth" "github.com/opencontainers/go-digest" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/remotes/pull_test.go b/remotes/pull_test.go index 4741590..ef5a259 100644 --- a/remotes/pull_test.go +++ b/remotes/pull_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/cnabio/cnab-to-oci/tests" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" ) diff --git a/remotes/push.go b/remotes/push.go index a34d1cf..d7fb3da 100644 --- a/remotes/push.go +++ b/remotes/push.go @@ -17,10 +17,10 @@ import ( "github.com/containerd/containerd/images" "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/distribution/reference" "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config/credentials" configtypes "github.com/docker/cli/cli/config/types" - "github.com/docker/distribution/reference" "github.com/docker/docker/api/types/image" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/pkg/jsonmessage" diff --git a/remotes/push_test.go b/remotes/push_test.go index 67c93fb..74723f3 100644 --- a/remotes/push_test.go +++ b/remotes/push_test.go @@ -11,7 +11,7 @@ import ( "github.com/cnabio/cnab-go/bundle" "github.com/cnabio/cnab-to-oci/converter" "github.com/cnabio/cnab-to-oci/tests" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" ) diff --git a/remotes/resolver.go b/remotes/resolver.go index 548521b..8bc7a37 100644 --- a/remotes/resolver.go +++ b/remotes/resolver.go @@ -9,8 +9,8 @@ import ( "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" + "github.com/distribution/reference" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/distribution/reference" "github.com/docker/docker/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) From 175dc7b59994ceb9a52c96acdd6cec68df9f03db Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:54:17 +0000 Subject: [PATCH 2/9] Bumped some docker deps Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- converter/convert_test.go | 2 +- converter/types.go | 2 +- go.mod | 3 +++ go.sum | 24 ++++++++++++------------ remotes/pull.go | 2 +- tests/helpers.go | 2 +- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/converter/convert_test.go b/converter/convert_test.go index b42eef6..31f8329 100644 --- a/converter/convert_test.go +++ b/converter/convert_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/cnabio/cnab-to-oci/tests" + "github.com/distribution/distribution/manifest/schema2" "github.com/distribution/reference" - "github.com/docker/distribution/manifest/schema2" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" ) diff --git a/converter/types.go b/converter/types.go index e6a834e..f837a06 100644 --- a/converter/types.go +++ b/converter/types.go @@ -4,8 +4,8 @@ import ( "encoding/json" "github.com/cnabio/cnab-go/bundle" + "github.com/distribution/distribution/manifest/schema2" "github.com/docker/distribution" - "github.com/docker/distribution/manifest/schema2" "github.com/opencontainers/go-digest" ocischema "github.com/opencontainers/image-spec/specs-go" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/go.mod b/go.mod index b05f9c4..c373e34 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/containerd/log v0.1.0 github.com/containerd/platforms v0.2.1 github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 + github.com/distribution/distribution v2.8.3+incompatible github.com/distribution/reference v0.6.1-0.20240718132515-8c942b0459df github.com/docker/cli v27.4.1+incompatible github.com/docker/distribution v2.8.3+incompatible @@ -65,7 +66,9 @@ require ( go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect go.opentelemetry.io/otel v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.33.0 // indirect + go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.33.0 // indirect golang.org/x/net v0.34.0 // indirect golang.org/x/sys v0.29.0 // indirect diff --git a/go.sum b/go.sum index f61d742..9c1e71c 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= 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/distribution/distribution v2.8.3+incompatible h1:RlpEXBLq/WPXYvBYMDAmBX/SnhD67qwtvW/DzKc8pAo= +github.com/distribution/distribution v2.8.3+incompatible/go.mod h1:EgLm2NgWtdKgzF9NpMzUKgzmR7AMmb0VQi2B+ZzDRjc= github.com/distribution/reference v0.6.1-0.20240718132515-8c942b0459df h1:5dsN0RDoKdzqhxBIJ/fJxZGAtcAbkCd6FUPtkao6ROM= github.com/distribution/reference v0.6.1-0.20240718132515-8c942b0459df/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/cli v27.4.1+incompatible h1:VzPiUlRJ/xh+otB75gva3r05isHMo5wXDfPRi5/b4hI= @@ -97,8 +97,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN9coASF1GusYX6AlU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -208,14 +208,14 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEj go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 h1:K0XaT3DwHAcV4nKLzcQvwAgSyisUghWoY20I7huthMk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0/go.mod h1:B5Ki776z/MBnVha1Nzwp5arlzBbE3+1jk+pGmaP5HME= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 h1:IJFEoHiytixx8cMiVAO+GmHR6Frwu+u5Ur8njpFO6Ac= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0/go.mod h1:3rHrKNtLIoS0oZwkY2vxi+oJcwFRWdtUyRII+so45p8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 h1:cMyu9O88joYEaI47CnQkxO1XZdpoTF9fEnW2duIddhw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0/go.mod h1:6Am3rn7P9TVVeXYG+wtcGE7IE1tsQ+bP3AuWcKt/gOI= go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= -go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= -go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= @@ -266,8 +266,8 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 h1:fVoAXEKA4+yufmbdVYv+SE73+cPZbbbe8paLsHfkK+U= -google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53/go.mod h1:riSXTwQ4+nqmPGtobMFyW5FqVAmIs0St6VPp4Ug7CE4= +google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g= +google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:dguCy7UOdZhTvLzDyt15+rOrawrpM4q7DD9dQ1P11P4= google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1:3UsHvIr4Wc2aW4brOaSCmcxh9ksica6fHEr8P1XhkYw= google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= diff --git a/remotes/pull.go b/remotes/pull.go index fe65e19..914ccb8 100644 --- a/remotes/pull.go +++ b/remotes/pull.go @@ -14,9 +14,9 @@ import ( "github.com/containerd/containerd/images" "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/distribution/distribution/registry/client/auth" "github.com/distribution/reference" "github.com/docker/cli/opts" - "github.com/docker/distribution/registry/client/auth" "github.com/opencontainers/go-digest" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/tests/helpers.go b/tests/helpers.go index 673adc3..0e59c30 100644 --- a/tests/helpers.go +++ b/tests/helpers.go @@ -4,7 +4,7 @@ import ( "github.com/cnabio/cnab-go/bundle" "github.com/cnabio/cnab-go/bundle/definition" "github.com/cnabio/cnab-to-oci/relocation" - "github.com/docker/distribution/manifest/schema2" + "github.com/distribution/distribution/manifest/schema2" "github.com/opencontainers/go-digest" ocischema "github.com/opencontainers/image-spec/specs-go" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" From 73f4b0ab33e9882fa75fc9eabd41aac061c12dad Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:21:25 +0000 Subject: [PATCH 3/9] Bumped golanglint-ci to avoid OOM errors Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 710711a..aceb620 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ check_go_env: get-tools: go install golang.org/x/tools/cmd/goimports@latest - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4 # Default build build: bin/cnab-to-oci From 3d13b948e29499a7b1d7a22210cfb4172bfaf260 Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Mon, 13 Jan 2025 20:28:18 +0000 Subject: [PATCH 4/9] Fixed linting errors Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- cmd/cnab-to-oci/fixup.go | 2 +- cmd/cnab-to-oci/main.go | 2 +- cmd/cnab-to-oci/pull.go | 2 +- cmd/cnab-to-oci/push.go | 2 +- cmd/cnab-to-oci/version.go | 2 +- remotes/fixup_test.go | 2 +- remotes/fixupoptions.go | 2 +- remotes/log.go | 2 +- remotes/mocks_test.go | 16 ++++++++-------- remotes/mount.go | 2 +- remotes/promises_test.go | 20 ++++++++++---------- remotes/pull.go | 2 +- remotes/push.go | 2 +- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cmd/cnab-to-oci/fixup.go b/cmd/cnab-to-oci/fixup.go index bb70915..d6baf81 100644 --- a/cmd/cnab-to-oci/fixup.go +++ b/cmd/cnab-to-oci/fixup.go @@ -29,7 +29,7 @@ func fixupCmd() *cobra.Command { Short: "Fixes the digest of an image", Long: "The fixup command resolves all the digest references from a registry and patches the bundle.json with them.", Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { opts.input = args[0] return runFixup(opts) }, diff --git a/cmd/cnab-to-oci/main.go b/cmd/cnab-to-oci/main.go index 91eb5cc..957fde9 100644 --- a/cmd/cnab-to-oci/main.go +++ b/cmd/cnab-to-oci/main.go @@ -12,7 +12,7 @@ func main() { cmd := &cobra.Command{ Use: "cnab-to-oci [options]", SilenceUsage: true, - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { + PersistentPreRunE: func(_ *cobra.Command, _ []string) error { level, err := logrus.ParseLevel(logLevel) if err != nil { return err diff --git a/cmd/cnab-to-oci/pull.go b/cmd/cnab-to-oci/pull.go index b41d4ab..682370d 100644 --- a/cmd/cnab-to-oci/pull.go +++ b/cmd/cnab-to-oci/pull.go @@ -25,7 +25,7 @@ func pullCmd() *cobra.Command { Use: "pull [options]", Short: "Pulls an image reference", Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { opts.targetRef = args[0] return runPull(opts) }, diff --git a/cmd/cnab-to-oci/push.go b/cmd/cnab-to-oci/push.go index 683808b..f1f87ec 100644 --- a/cmd/cnab-to-oci/push.go +++ b/cmd/cnab-to-oci/push.go @@ -31,7 +31,7 @@ func pushCmd() *cobra.Command { Use: "push [options]", Short: "Fixes and pushes the bundle to an registry", Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { opts.input = args[0] if opts.targetRef == "" { return errors.New("--target flag must be set with a namespace ") diff --git a/cmd/cnab-to-oci/version.go b/cmd/cnab-to-oci/version.go index 8b7019a..6b19f00 100644 --- a/cmd/cnab-to-oci/version.go +++ b/cmd/cnab-to-oci/version.go @@ -11,7 +11,7 @@ func versionCmd() *cobra.Command { cmd := &cobra.Command{ Use: "version", Short: "Shows the version of cnab-to-oci", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { fmt.Println(internal.FullVersion()) return nil }, diff --git a/remotes/fixup_test.go b/remotes/fixup_test.go index 95d916c..10a4fab 100644 --- a/remotes/fixup_test.go +++ b/remotes/fixup_test.go @@ -11,7 +11,7 @@ import ( "github.com/cnabio/cnab-go/bundle" "github.com/cnabio/cnab-to-oci/relocation" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/platforms" + "github.com/containerd/platforms" "github.com/distribution/reference" "github.com/opencontainers/go-digest" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/remotes/fixupoptions.go b/remotes/fixupoptions.go index 0607937..3373641 100644 --- a/remotes/fixupoptions.go +++ b/remotes/fixupoptions.go @@ -7,8 +7,8 @@ import ( "github.com/cnabio/cnab-go/bundle" "github.com/cnabio/cnab-to-oci/internal" "github.com/cnabio/cnab-to-oci/relocation" - "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes" + "github.com/containerd/platforms" "github.com/distribution/reference" ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/remotes/log.go b/remotes/log.go index 0daeb16..03aa503 100644 --- a/remotes/log.go +++ b/remotes/log.go @@ -5,7 +5,7 @@ import ( "encoding/json" "io" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/sirupsen/logrus" ) diff --git a/remotes/mocks_test.go b/remotes/mocks_test.go index 4af7d79..19dc309 100644 --- a/remotes/mocks_test.go +++ b/remotes/mocks_test.go @@ -29,7 +29,7 @@ func (r *mockResolver) Resolve(_ context.Context, ref string) (string, ocischema } return ref, descriptor, nil } -func (r *mockResolver) Fetcher(_ context.Context, ref string) (remotes.Fetcher, error) { +func (r *mockResolver) Fetcher(_ context.Context, _ string) (remotes.Fetcher, error) { return r.fetcher, nil } func (r *mockResolver) Pusher(_ context.Context, ref string) (remotes.Pusher, error) { @@ -52,7 +52,7 @@ func newMockPusher(ret []error) *mockPusher { } } -func (p *mockPusher) Push(ctx context.Context, d ocischemav1.Descriptor) (content.Writer, error) { +func (p *mockPusher) Push(_ context.Context, d ocischemav1.Descriptor) (content.Writer, error) { p.pushedDescriptors = append(p.pushedDescriptors, d) buf := &bytes.Buffer{} p.buffers = append(p.buffers, buf) @@ -72,11 +72,11 @@ type mockWriter struct { } func (w mockWriter) Digest() digest.Digest { return "" } -func (w mockWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error { +func (w mockWriter) Commit(_ context.Context, _ int64, _ digest.Digest, _ ...content.Opt) error { return nil } func (w mockWriter) Status() (content.Status, error) { return content.Status{}, nil } -func (w mockWriter) Truncate(size int64) error { return nil } +func (w mockWriter) Truncate(_ int64) error { return nil } type nopWriteCloser struct { *bytes.Buffer @@ -89,7 +89,7 @@ type mockFetcher struct { indexBuffers []*bytes.Buffer } -func (f *mockFetcher) Fetch(ctx context.Context, desc ocischemav1.Descriptor) (io.ReadCloser, error) { +func (f *mockFetcher) Fetch(_ context.Context, _ ocischemav1.Descriptor) (io.ReadCloser, error) { rc := io.NopCloser(f.indexBuffers[0]) f.indexBuffers = f.indexBuffers[1:] return rc, nil @@ -98,7 +98,7 @@ func (f *mockFetcher) Fetch(ctx context.Context, desc ocischemav1.Descriptor) (i type mockReadCloser struct { } -func (rc mockReadCloser) Read(p []byte) (n int, err error) { +func (rc mockReadCloser) Read(_ []byte) (n int, err error) { return 0, io.EOF } @@ -115,11 +115,11 @@ func newMockImageClient() *mockImageClient { return &mockImageClient{taggedImages: map[string]string{}} } -func (c *mockImageClient) ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error) { +func (c *mockImageClient) ImagePush(_ context.Context, _ string, _ image.PushOptions) (io.ReadCloser, error) { c.pushedImages++ return mockReadCloser{}, nil } -func (c *mockImageClient) ImageTag(ctx context.Context, image, ref string) error { +func (c *mockImageClient) ImageTag(_ context.Context, image, ref string) error { c.taggedImages[image] = ref return nil } diff --git a/remotes/mount.go b/remotes/mount.go index 917b263..89749fe 100644 --- a/remotes/mount.go +++ b/remotes/mount.go @@ -157,7 +157,7 @@ type descriptorContentHandler struct { func (h *descriptorContentHandler) createCopyTask(ctx context.Context, descProgress *descriptorProgress) (func(ctx context.Context) error, error) { if _, scheduled := h.layersScheduled[descProgress.Digest]; scheduled { - return func(ctx context.Context) error { + return func(_ context.Context) error { // Skip. We have already scheduled a copy of this layer return nil }, nil diff --git a/remotes/promises_test.go b/remotes/promises_test.go index 074a9b4..2b624e4 100644 --- a/remotes/promises_test.go +++ b/remotes/promises_test.go @@ -19,14 +19,14 @@ func TestPromisesNominal(t *testing.T) { scheduler := newErrgroupScheduler(ctx, 4, 5) var deps []dependency for i := 0; i < 4; i++ { - deps = append(deps, scheduler.schedule(func(ctx context.Context) error { + deps = append(deps, scheduler.schedule(func(_ context.Context) error { mut.Lock() defer mut.Unlock() n++ return nil })) } - final := newPromise(scheduler, whenAll(deps)).then(func(ctx context.Context) error { + final := newPromise(scheduler, whenAll(deps)).then(func(_ context.Context) error { dependingValue = n return nil }) @@ -63,7 +63,7 @@ func TestPromisesErrorUnblock(t *testing.T) { done = true return nil }) - erroring := scheduler.schedule(func(ctx context.Context) error { + erroring := scheduler.schedule(func(_ context.Context) error { return errors.New("boom") }) assert.ErrorContains(t, erroring.wait(), "boom") @@ -75,11 +75,11 @@ func TestPromisesScheduleErroredDontBlockDontRun(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() scheduler := newErrgroupScheduler(ctx, 4, 5) - errErroringTask := scheduler.schedule(func(ctx context.Context) error { + errErroringTask := scheduler.schedule(func(_ context.Context) error { return errors.New("boom") }).wait() var done bool - errAfterError := scheduler.schedule(func(ctx context.Context) error { + errAfterError := scheduler.schedule(func(_ context.Context) error { done = true return nil }).wait() @@ -92,12 +92,12 @@ func TestPromisesErrorUnblockDeps(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() scheduler := newErrgroupScheduler(ctx, 4, 5) - dep := scheduler.schedule(func(ctx context.Context) error { + dep := scheduler.schedule(func(_ context.Context) error { time.Sleep(200) return errors.New("boom") }) for i := 0; i < 50; i++ { - dep = dep.then(func(ctx context.Context) error { + dep = dep.then(func(_ context.Context) error { return nil }) } @@ -109,9 +109,9 @@ func TestPromisesUnwrwap(t *testing.T) { defer cancel() scheduler := newErrgroupScheduler(ctx, 4, 5) var done1, done2 bool - p := scheduleAndUnwrap(scheduler, func(ctx context.Context) (dependency, error) { + p := scheduleAndUnwrap(scheduler, func(_ context.Context) (dependency, error) { done1 = true - return scheduler.schedule(func(ctx context.Context) error { + return scheduler.schedule(func(_ context.Context) error { time.Sleep(200) done2 = true return nil @@ -127,7 +127,7 @@ func TestPromisesUnwrwapWithError(t *testing.T) { defer cancel() scheduler := newErrgroupScheduler(ctx, 4, 5) var done bool - p := scheduleAndUnwrap(scheduler, func(ctx context.Context) (dependency, error) { + p := scheduleAndUnwrap(scheduler, func(_ context.Context) (dependency, error) { done = true return nil, errors.New("boom") }) diff --git a/remotes/pull.go b/remotes/pull.go index 914ccb8..3d7b254 100644 --- a/remotes/pull.go +++ b/remotes/pull.go @@ -12,8 +12,8 @@ import ( "github.com/cnabio/cnab-to-oci/relocation" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" "github.com/distribution/distribution/registry/client/auth" "github.com/distribution/reference" "github.com/docker/cli/opts" diff --git a/remotes/push.go b/remotes/push.go index d7fb3da..8ffc239 100644 --- a/remotes/push.go +++ b/remotes/push.go @@ -15,8 +15,8 @@ import ( "github.com/cnabio/cnab-to-oci/relocation" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" "github.com/distribution/reference" "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config/credentials" From 7b8240e3dae4f0829e060b6ba6ad4b51b2fc1f83 Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Mon, 13 Jan 2025 20:37:38 +0000 Subject: [PATCH 5/9] Use a newer version of the setup-go workflow, hopefully that supports toolchain Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b8822bc..b3050e7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,7 +9,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true From c184344c1b0a40c6b27bc5cce504b1386b28e9e0 Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Mon, 13 Jan 2025 20:42:20 +0000 Subject: [PATCH 6/9] Newer golang and alpine in the dockerfile Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cd5691b..d614c54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG ALPINE_VERSION=3.17 -ARG GO_VERSION=1.19.6 +ARG ALPINE_VERSION=3.21 +ARG GO_VERSION=1.23.4 # build image FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as build From 80e123fae6dcef0941fcc752817fb354a1d822f6 Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:13:55 +0000 Subject: [PATCH 7/9] Swapped docker image as whalesay is defunct Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- e2e/e2e_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 264c1dc..6fd26ad 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -36,14 +36,13 @@ func TestPushAndPullCNAB(t *testing.T) { // Fetch service images runCmd(t, icmd.Command("docker", "pull", "hashicorp/http-echo")) - // We are using whalesay because it has duplicate layers in the image - runCmd(t, icmd.Command("docker", "pull", "docker/whalesay")) + runCmd(t, icmd.Command("docker", "pull", "docker/compose")) runCmd(t, icmd.Command("docker", "tag", "hashicorp/http-echo", serviceImageName)) - runCmd(t, icmd.Command("docker", "tag", "docker/whalesay", whalesayImageName)) + runCmd(t, icmd.Command("docker", "tag", "docker/compose", whalesayImageName)) // Tidy up my room defer func() { - runCmd(t, icmd.Command("docker", "image", "rm", "-f", invocationImageName, "hashicorp/http-echo", serviceImageName, "docker/whalesay", whalesayImageName)) + runCmd(t, icmd.Command("docker", "image", "rm", "-f", invocationImageName, "hashicorp/http-echo", serviceImageName, "docker/compose", whalesayImageName)) }() // Push the images to the registry From a1776e4fe6c021cede7e0a6f782ac9700c5071ec Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:36:40 +0000 Subject: [PATCH 8/9] Changed how we get the docker port Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- e2e/helper_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/e2e/helper_test.go b/e2e/helper_test.go index 6a10c55..4b7cd7a 100644 --- a/e2e/helper_test.go +++ b/e2e/helper_test.go @@ -38,5 +38,6 @@ func (c *Container) Stop(t *testing.T) { // GetAddress returns the host:port this container listens on func (c *Container) GetAddress(t *testing.T) string { result := icmd.RunCommand("docker", "port", c.container, strconv.Itoa(c.privatePort)).Assert(t, icmd.Success) - return fmt.Sprintf("127.0.0.1:%v", strings.Trim(strings.Split(result.Stdout(), ":")[1], " \r\n")) + port := strings.Split(strings.Split(result.Stdout(), ":")[1], "\n")[0] + return fmt.Sprintf("127.0.0.1:%v", strings.Trim(port, " \r\n")) } From 5f0668e994ba2fd1832d0642d7beb7ff1f39ef2c Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:22:38 +0000 Subject: [PATCH 9/9] Updated golden data Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --- Dockerfile | 4 ++-- e2e/testdata/bundle.json.golden.template | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d614c54..ffda05c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG ALPINE_VERSION=3.21 ARG GO_VERSION=1.23.4 # build image -FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as build +FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build ARG DOCKERCLI_VERSION=20.10.23 ARG DOCKERCLI_CHANNEL=stable @@ -30,7 +30,7 @@ RUN make BUILDTIME=$BUILDTIME COMMIT=$COMMIT TAG=$TAG bin/cnab-to-oci &&\ make BUILDTIME=$BUILDTIME COMMIT=$COMMIT TAG=$TAG build-e2e-test # e2e image -FROM alpine:${ALPINE_VERSION} as e2e +FROM alpine:${ALPINE_VERSION} AS e2e # copy all the elements needed for e2e tests from build image COPY --from=build /go/docker/docker /usr/bin/docker diff --git a/e2e/testdata/bundle.json.golden.template b/e2e/testdata/bundle.json.golden.template index 5333db2..4b3fc2b 100644 --- a/e2e/testdata/bundle.json.golden.template +++ b/e2e/testdata/bundle.json.golden.template @@ -1 +1 @@ -{"actions":{"io.cnab.status":{}},"description":"Hello, World!","images":{"hello":{"contentDigest":"sha256:61d5cb94d7e546518a7bbd5bee06bfad0ecea8f56a75b084522a43dccbbcd845","description":"hello","image":"{{ .ServiceImage }}","imageType":"docker","mediaType":"application/vnd.docker.distribution.manifest.v2+json","size":528},"whalesay":{"contentDigest":"sha256:df326a383b4a036fd5a33402248027d1c972954622924158a28744ed5f9fca1e","description":"whalesay","image":"{{ .WhalesayImage }}","imageType":"docker","mediaType":"application/vnd.docker.distribution.manifest.v2+json","size":2402}},"invocationImages":[{"contentDigest":"{{ .InvocationDigest }}","image":"{{ .InvocationImage }}","imageType":"docker","mediaType":"application/vnd.docker.distribution.manifest.v2+json","size":941}],"maintainers":[{"email":"user@email.com","name":"user"}],"name":"hello-world","parameters":{"fields":{"definition":"","destination":null}},"schemaVersion":"v1.0.0","version":"0.1.0"} \ No newline at end of file +{"actions":{"io.cnab.status":{}},"description":"Hello, World!","images":{"hello":{"contentDigest":"sha256:2c213d6c05a0f68adfe9c7fe1a78a314e5c4fee783e2ee8592d49f10d0c4513f","description":"hello","image":"127.0.0.1:32797/e2e/http-echo","imageType":"docker","mediaType":"application/vnd.docker.distribution.manifest.v2+json","size":2401},"whalesay":{"contentDigest":"sha256:b60a020c0f68047b353a4a747f27f5e5ddb17116b7b018762edfb6f7a6439a82","description":"whalesay","image":"127.0.0.1:32797/e2e/whalesay","imageType":"docker","mediaType":"application/vnd.docker.distribution.manifest.v2+json","size":1158}},"invocationImages":[{"contentDigest":"sha256:3079367dd5c4c6c4f99a7842112d062ce91ea35c934e6ea2d6677de11be0a23b","image":"127.0.0.1:32797/e2e/hello-world:0.1.0-invoc","imageType":"docker","mediaType":"application/vnd.docker.distribution.manifest.v2+json","size":941}],"maintainers":[{"email":"user@email.com","name":"user"}],"name":"hello-world","parameters":{"fields":{"definition":"","destination":null}},"schemaVersion":"v1.0.0","version":"0.1.0"} \ No newline at end of file