estesp / manifest-tool

Command line tool to create and query container image manifest list/indexes
Apache License 2.0
741 stars 92 forks source link

upgrade to oras.land/oras.go/v2 #197

Closed deitch closed 1 year ago

deitch commented 1 year ago

Replaces oras.land/oras.go (v1) with oras.land/oras.go/v2. As a result of this and the changes in it:

While at it, cleaned up a lint dependency and commented some others, so it will pass linting.

Also updated yaml.v2 to yaml.v3, which, in turn, needed a more recent version of go.

deitch commented 1 year ago

Note: I did not run any real functional tests, not sure if the CI here does it.

deitch commented 1 year ago

Derivative note: both of the big libraries that interact directly with registries - oras and ggcr - now avoid containerd library entirely. This is primarily due to the sheer size of the import stack, as far as I know. Either way, perhaps manifest-tool should use one of them more directly and simply push/inspect/pull manifests directly rather than using the containerd/remotes.Resolver and the complex handler chain?

deitch commented 1 year ago

I was in error; that fix did not get lint to pass. I even tried bumping to latest golangci-lint v1.50.1, no help. The oddest error here:

level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package syncutil: could not load export data: no export data for \"oras.land/oras-go/v2/internal/syncutil\""
[23](https://github.com/estesp/manifest-tool/actions/runs/4023046289/jobs/6913457873#step:4:25)
  level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: buildir: failed to load package syncutil: could not load export data: no export data for \"oras.land/oras-go/v2/internal/syncutil\"\n\n"
[24](https://github.com/estesp/manifest-tool/actions/runs/4023046289/jobs/6913457873#step:4:26)

I can run it locally, the only thing syncutil package depends upon is sync and golang.org/x/sync (and sub packages). 🤷‍♂️

deitch commented 1 year ago

Aha! That did it! Installed go explicitly.

estesp commented 1 year ago

Sorry, forgot to come back to your work here and just did some vendoring updates--created some conflicts that should be easy to resolve with a repush.

deitch commented 1 year ago

Sure @estesp ; done