Skip to content

api/compat: switch to moby/moby#28057

Merged
Luap99 merged 4 commits intocontainers:mainfrom
jankaluza:27536
Mar 9, 2026
Merged

api/compat: switch to moby/moby#28057
Luap99 merged 4 commits intocontainers:mainfrom
jankaluza:27536

Conversation

@jankaluza
Copy link
Member

@jankaluza jankaluza commented Feb 10, 2026

Replace github.com/docker/docker API imports with github.com/moby/moby across compat handlers, swagger models, and tests to align with upstream type definitions.

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

None

@jankaluza jankaluza marked this pull request as draft February 10, 2026 12:39
@github-actions github-actions bot added machine kind/api-change Change to remote API; merits scrutiny labels Feb 10, 2026
@jankaluza
Copy link
Member Author

@Luap99 , could you please check system.go (https://github.com/containers/podman/pull/28057/changes#diff-2facc6ee4ed6c946594f6ecde156045ee8227e22a06e966273a199f79888c339) and tell me if that's how you expect the support for multiple versions to be done?

@packit-as-a-service
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

1 similar comment
@packit-as-a-service
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@Luap99
Copy link
Member

Luap99 commented Feb 10, 2026

Not a proper review but yeah looks about right logic wise

@jankaluza
Copy link
Member Author

Thanks, that's all I needed so far :-).

@jankaluza jankaluza force-pushed the 27536 branch 5 times, most recently from d6a3860 to c50fa7a Compare February 12, 2026 10:27
@jankaluza jankaluza added the bloat_approved Approve a PR in which binary file size grows by over 50k label Feb 12, 2026
@packit-as-a-service
Copy link

tmt tests failed for commit d6a3860. @lsm5, @psss, @thrix please check.

@packit-as-a-service
Copy link

tmt tests failed for commit c50fa7a. @lsm5, @psss, @thrix please check.

@packit-as-a-service
Copy link

tmt tests failed for commit cda638a. @lsm5, @psss, @thrix please check.

@packit-as-a-service
Copy link

tmt tests failed for commit ef67519. @lsm5, @psss, @thrix please check.

@jankaluza jankaluza force-pushed the 27536 branch 2 times, most recently from 001b4f5 to 43ca938 Compare February 13, 2026 10:27
@packit-as-a-service
Copy link

tmt tests failed for commit 001b4f5. @lsm5, @psss, @thrix please check.

@jankaluza jankaluza force-pushed the 27536 branch 2 times, most recently from dd2fdb5 to b6d4436 Compare February 13, 2026 11:15
@packit-as-a-service
Copy link

tmt tests failed for commit b6d4436. @lsm5, @psss, @thrix please check.

@jankaluza jankaluza force-pushed the 27536 branch 3 times, most recently from 502e398 to 1556b9f Compare February 17, 2026 09:58
@Luap99
Copy link
Member

Luap99 commented Feb 18, 2026

If this is ready for review can you drop draft and wip title so others will take a look as well

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall though I have not checked stuff in detail

StopTimeout: &stopTimeout,
Shell: nil,
},
MacAddress: "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed, by default it will always be the zero value (i.e. empty string)
but sure it does not hurt either

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that to stay consistent with the rest of the code where we explicitly set an empty string.

@jankaluza jankaluza marked this pull request as ready for review February 19, 2026 09:11
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jankaluza
Copy link
Member Author

@Luap99 , I'm thinking if we could merge this one or if I should ask someone for additional review. What do you think?

@Luap99
Copy link
Member

Luap99 commented Feb 23, 2026

well we generally need two reviews unless it is something trivial so yeah...

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the code, and it seems good to me. (Just two questions.) I'm a little bothered by the structures that start with 'Legacy'. For now, it's okay, but for 6.0 we should throw them away or rename them differently or start deprecation, because the naming implies we're trying to support something old. Also, I have a feeling that we probably missed filling in some new fields in the structures, but tracking that seems pretty hard. I think the best effort approach is to wait until someone files an issue.


Maybe in the future, we should create a smoke test for the compat API to check if it works with Docker, ensuring it functions correctly for at least the basic use cases.

ID: report.ID,
})
if err == nil {
report.ProgressMessage = string(b)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output from report.Progress.String() seems to be different from the marshaled JSON. Won't this break callers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good point. I double-checked the moby/moby code and you are right. I've backported the original String() function to our images_push.go. I think there's no other way around it, because this String() function is not part of public API anymore.

@packit-as-a-service
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@jankaluza
Copy link
Member Author

@Honny1 , yeah. That compat code seems to be all over the place. Ideally we should just take the client versions we support and run the API calls with them to ensure they work with our API and report failures. Or really compare our responses with docker responses as part of tests.

@jankaluza
Copy link
Member Author

I've addressed the comments and rebased the PR.

@jankaluza
Copy link
Member Author

/packit retest-failed

1 similar comment
@jankaluza
Copy link
Member Author

/packit retest-failed

@jankaluza
Copy link
Member Author

@Honny1 do you think you could find some time to review this one again, please? :-)

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found docker/docker and other Docker libs in go.mod. Is this correct?

github.com/docker/distribution v2.8.3+incompatible
github.com/docker/docker v28.5.2+incompatible
github.com/docker/go-connections v0.6.0
github.com/docker/go-plugins-helpers v0.0.0-20240701071450-45e2431495c8
github.com/docker/go-units v0.5.0

@Luap99
Copy link
Member

Luap99 commented Mar 4, 2026

I found docker/docker and other Docker libs in go.mod. Is this correct?

github.com/docker/distribution v2.8.3+incompatible
github.com/docker/docker v28.5.2+incompatible
github.com/docker/go-connections v0.6.0
github.com/docker/go-plugins-helpers v0.0.0-20240701071450-45e2431495c8
github.com/docker/go-units v0.5.0

#28057 (review)

There is still one package we depend on directly (some indirectly which would take even longer to get rid of), it should not block the API changes for now

VirtualSize int64 `json:"VirtualSize,omitempty"`
}

// Deprecated: kept to maintain backwards compatibility with API < v1.52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter is flagging a deprecation notice. I would silence it when these deprecated structures are used.

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, once CI passes.

@jankaluza jankaluza changed the title [WIP] api/compat: switch to moby/moby api/compat: switch to moby/moby Mar 9, 2026
Replace github.com/docker/docker API imports with github.com/moby/moby
across compat handlers, swagger models, and tests to align with upstream
type definitions.

Fixes: containers#27536.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
The JSONProgress is not part of moby/moby API anymore:
moby/moby@f4127d7

To stay compatible with the previous client version, this commit backports
the jsonmessage.JSONProgress.String() and uses it to genereate
the progress report.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
@jankaluza
Copy link
Member Author

@Honny1 , @Luap99 , I've rebased this PR and fixed the tests. I think we are good to merge.

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, on my side.

@Luap99 Luap99 merged commit 1c3cc92 into containers:main Mar 9, 2026
90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bloat_approved Approve a PR in which binary file size grows by over 50k kind/api-change Change to remote API; merits scrutiny machine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants