Skip to content

fix: omit empty list of platforms when serializing worker config #5968

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

fiam
Copy link
Collaborator

@fiam fiam commented May 13, 2025

Previously, when no platforms were explicitly defined in the config,
serialization would emit an empty array instead of omitting the field.
When loading this cofig, this prevented the worker from falling back
to default platform detection during initialization. By using omitempty,
we ensure the field is excluded when empty, allowing defaults to be
correctly applied.

Fixes #5740.

Signed-off-by: Alberto Garcia Hierro [email protected]

Previously, when no platforms were explicitly defined in the config,
serialization would emit an empty array instead of omitting the field.
When loading this cofig, this prevented the worker from falling back
to default platform detection during initialization. By using `omitempty`,
we ensure the field is excluded when empty, allowing defaults to be
correctly applied.

Fixes moby#5740.

Signed-off-by: Alberto Garcia Hierro <[email protected]>
@fiam fiam force-pushed the alberto/omitempty-platforms-list branch from b2dc826 to 50247f3 Compare May 13, 2025 14:51
@tonistiigi tonistiigi merged commit 90196ef into moby:master May 13, 2025
111 checks passed
@MalteMagnussen
Copy link

So before this change:

Image that did not explicitly have a platform set, got an empty array for platforms?

After this change:

Images get the same platform as the builder node?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runc worker does not always report the correct list of platforms
3 participants