Skip to content

Commit

Permalink
Improve error message when cnab-to-oci fixes up a bundle
Browse files Browse the repository at this point in the history
When cnab-to-oci fixes up a bundle after publishing it, if any error
occurs we only get a single error message

"failed to fixup the image for service InvocationImage"

This bumps our cnab-to-oci to use the patch in

cnabio/cnab-to-oci#113

so that we get a more detailed error message that indicates the image
that failed, and which fixup step.

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
carolynvs committed Nov 9, 2021
1 parent 9087eb3 commit 3446824
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ replace (
// tags based on the same underlying version of cnab-go.
github.com/cnabio/cnab-go => github.com/getporter/cnab-go v0.19.0-porter.4

// return-copy-error
// See https://github.com/cnabio/cnab-to-oci/pull/113
github.com/cnabio/cnab-to-oci => github.com/getporter/cnab-to-oci v0.3.1-porter.1

// See https://github.com/containerd/containerd/issues/3031
// When I try to just use the require, go is shortening it to v2.7.1+incompatible which then fails to build...
github.com/docker/distribution => github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible
Expand All @@ -22,7 +26,8 @@ replace (
// local-keyword-registry
github.com/qri-io/jsonschema => github.com/carolynvs/jsonschema v0.2.1-0.20210602145235-283986347fba

golang.org/x/sys => golang.org/x/sys v0.0.0-20190830141801-acfa387b8d69
// Pin to a version that supports go 1.17. You get a weird panic on earlier commits with that new Go versions.
golang.org/x/sys => golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ github.com/cloudflare/cfssl v1.4.1 h1:vScfU2DrIUI9VPHBVeeAQ0q5A+9yshO1Gz+3QoUQiK
github.com/cloudflare/cfssl v1.4.1/go.mod h1:KManx/OJPb5QY+y0+o/898AMcM128sF0bURvoVUSjTo=
github.com/cloudflare/go-metrics v0.0.0-20151117154305-6a9aea36fb41/go.mod h1:eaZPlJWD+G9wseg1BuRXlHnjntPMrywMsyxf+LTOdP4=
github.com/cloudflare/redoctober v0.0.0-20171127175943-746a508df14c/go.mod h1:6Se34jNoqrd8bTxrmJB2Bg2aoZ2CdSXonils9NsiNgo=
github.com/cnabio/cnab-to-oci v0.3.1-beta1.0.20210614060230-e4d2bd5441c8 h1:oi/g+7v0mVYfp5iETwm7DO6SFxpsq0hCN3fzywA6Lrk=
github.com/cnabio/cnab-to-oci v0.3.1-beta1.0.20210614060230-e4d2bd5441c8/go.mod h1:nl9mHZV0Tvj6ZirWkjpiWuVp71RenwUQ98KHA9ZY27g=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340 h1:9atoWyI9RtXFwf7UDbme/6M8Ud0rFrx+Q3ZWgSnsxtw=
github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
Expand Down Expand Up @@ -220,6 +218,8 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/getporter/cnab-go v0.19.0-porter.4 h1:HnAP2LdeYiAi0GX0r7RBd0MdtGN0IurC/inXXzyBzZw=
github.com/getporter/cnab-go v0.19.0-porter.4/go.mod h1:kRvp8b/q/qbayAj/TSztifSnz/5MVxaH0gYn/Vk9YwI=
github.com/getporter/cnab-to-oci v0.3.1-porter.1 h1:FGVALQRe57uZwivLQW/BoTqyXMw1Og7HqdxBURL/u6k=
github.com/getporter/cnab-to-oci v0.3.1-porter.1/go.mod h1:EM5BN83Hf0YCBQrkdYNuT2XamG9BfKBDxGuA0I3nZ3U=
github.com/getporter/go-plugin v1.4.0-improved-configuration.1 h1:Y5P+fuDCpuvf5zkgtNpRA9ltbIPulH6sp1zEn9YjJP4=
github.com/getporter/go-plugin v1.4.0-improved-configuration.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ=
github.com/getsentry/raven-go v0.0.0-20180121060056-563b81fc02b7/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
Expand Down Expand Up @@ -781,8 +781,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190830141801-acfa387b8d69 h1:Wdn4Yb8d5VrsO3jWgaeSZss09x1VLVBMePDh4VW/xSQ=
golang.org/x/sys v0.0.0-20190830141801-acfa387b8d69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
2 changes: 1 addition & 1 deletion pkg/cnab/cnab-to-oci/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (r *Registry) PullBundle(tag string, insecureRegistry bool) (bundle.Bundle,
fmt.Fprintln(r.Err, msg.String())
}

bun, reloMap, err := remotes.Pull(context.Background(), ref, r.createResolver(insecureRegistries))
bun, reloMap, _, err := remotes.Pull(context.Background(), ref, r.createResolver(insecureRegistries))
if err != nil {
return bundle.Bundle{}, nil, errors.Wrap(err, "unable to pull remote bundle")
}
Expand Down

0 comments on commit 3446824

Please sign in to comment.