Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/1.7] Add API go module #10189

Open
wants to merge 5 commits into
base: release/1.7
Choose a base branch
from

Conversation

dmcgowan
Copy link
Member

@dmcgowan dmcgowan commented May 8, 2024

Add api go module to 1.7. The plan is we do not need to update 1.7 to the 1.8 api go module if we separate it into its like we have done with main. The changes needed are minimal.

This helps the upgrade path from 1.7 to 2.0. After updating to 1.7, it should be easier to update to 2.0 since the api module can be just be upgraded to 1.8 and the latest containerd 1.7 will use the api package from the module.

For those not upgrading to 2.0 right away, the change should be invisible beside an extra dependency showing up in go module. We shouldn't need to do this for 1.6 since this only effects importers who are upgrading. In cases where an import is trying to stay on 1.6 but a dependency uses the latest version of 1.7, go mod would already forces the upgrade anyway.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dmcgowan
Copy link
Member Author

Let's get this one into the next 1.7 release

akhilerm and others added 4 commits May 28, 2024 07:45
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
(cherry picked from commit b16e357)
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
Allows the api version to be imported and upgraded separately from the
main module.

Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit e69efd5)
Signed-off-by: Derek McGowan <derek@mcg.dev>
@thaJeztah
Copy link
Member

Trying this PR in moby/moby (through a replace rule), but looks like it's not happy. Perhaps I need to force a version for the API module, or something else (or the API package must have aliases in it; or removed, not sure;

hack/vendor.sh
+ /Users/thajeztah/go/src/github.com/docker/docker/hack/with-go-mod.sh go mod tidy -modfile vendor.mod -compat 1.18
with-go-mod.sh: WARN: go.mod exists in the repository root!
with-go-mod.sh: WARN: Using your go.mod instead of our generated version -- this may misbehave!
go: downloading github.com/dmcgowan/containerd v1.7.16-0.20240528144541-4a2ca38f6508
go: downloading github.com/containerd/containerd/api v0.0.0
go: github.com/docker/docker/libcontainerd/remote imports
	github.com/containerd/containerd/api/events: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/libcontainerd/remote imports
	github.com/containerd/containerd/api/types: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/builder/builder-next imports
	github.com/containerd/containerd imports
	github.com/containerd/containerd/api/services/containers/v1: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/builder/builder-next imports
	github.com/containerd/containerd imports
	github.com/containerd/containerd/api/services/content/v1: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/builder/builder-next imports
	github.com/containerd/containerd imports
	github.com/containerd/containerd/api/services/diff/v1: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/builder/builder-next imports
	github.com/containerd/containerd imports
	github.com/containerd/containerd/api/services/events/v1: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/builder/builder-next imports
	github.com/containerd/containerd imports
	github.com/containerd/containerd/api/services/images/v1: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/builder/builder-next imports
	github.com/containerd/containerd imports
	github.com/containerd/containerd/api/services/introspection/v1: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/builder/builder-next imports
	github.com/containerd/containerd imports
	github.com/containerd/containerd/api/services/leases/v1: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0
go: github.com/docker/docker/builder/builder-next imports
	github.com/containerd/containerd imports
	github.com/containerd/containerd/api/services/namespaces/v1: reading github.com/containerd/containerd/api/go.mod at revision api/v0.0.0: unknown revision api/v0.0.0

@thaJeztah
Copy link
Member

thaJeztah commented May 28, 2024

OH! Maybe it works; but it's just version resolution; I manually added the API module, and that ... seems to go better.

Only now it enforces go1.22, because that's what the API module defines?

go 1.22.0

go 1.22.0

toolchain go1.22.2

@dmcgowan
Copy link
Member Author

@thaJeztah there is going to be no way to actually use this new API submodule until this PR gets merged. I could possibly push the dev branch into this repo so we can use the hash, however, it seems easier to just get this merged knowing there will be follows ups with an updated tag.

For the 1.22, that is currently on the api 1.8 which we could update, but it is the version we are going to import in 1.7 right now.

Signed-off-by: Derek McGowan <derek@mcg.dev>
@dmcgowan
Copy link
Member Author

Added one more commit to so 1.7 is compatible with the 1.7 and 1.8 api. This PR is testing with 1.7 and #10278 shows it working with the latest 1.8 rc.

This should be ready to merge now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

None yet

4 participants