Skip to content

api/types/swarm: remove deprecated ServiceSpec.Networks field#51184

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:remove_servicespec_networks
Oct 20, 2025
Merged

api/types/swarm: remove deprecated ServiceSpec.Networks field#51184
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:remove_servicespec_networks

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Oct 14, 2025

relates to:

api/types/swarm: remove deprecated ServiceSpec.Networks field

This field was deprecated in engine-api@5c4b684, which got vendored into Moby in moby@8f7a8c7 (API v1.25), and wired up in moby@99a98cc.

- Human readable description for the release notes

Go SDK: api/types/swarm: remove deprecated ServiceSpec.Networks field

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.0.0 milestone Oct 14, 2025
@thaJeztah thaJeztah force-pushed the remove_servicespec_networks branch from 8c6bff9 to fa42e21 Compare October 14, 2025 12:56
@thaJeztah thaJeztah added the kind/refactor PR's that refactor, or clean-up code label Oct 14, 2025
@thaJeztah thaJeztah force-pushed the remove_servicespec_networks branch from fa42e21 to 0df94a7 Compare October 14, 2025 13:15
@thaJeztah
Copy link
Member Author

Looks like docker-py needs some more updates;

=================================== FAILURES ===================================
_____________ ServiceTest.test_create_service_with_custom_networks _____________
tests/integration/api_service_test.py:379: in test_create_service_with_custom_networks
    assert 'Networks' in svc_info['Spec']
E   AssertionError: assert 'Networks' in {'Labels': {}, 'Mode': {'Replicated': {'Replicas': 1}}, 'Name': 'dockerpytest_a538894175d07404', 'TaskTemplate': {'Con...pec': {'Command': ['true'], 'Image': 'alpine:3.10', 'Isolation': 'default'}, 'ForceUpdate': 0, 'Runtime': 'container'}}
____________ ServiceTest.test_update_service_with_defaults_networks ____________
tests/integration/api_service_test.py:1128: in test_update_service_with_defaults_networks
    assert 'Networks' in svc_info['Spec']
E   AssertionError: assert 'Networks' in {'Labels': {}, 'Mode': {'Replicated': {'Replicas': 1}}, 'Name': 'dockerpytest_6d8e30f359c0f5e', 'TaskTemplate': {'Cont...pec': {'Command': ['true'], 'Image': 'alpine:3.10', 'Isolation': 'default'}, 'ForceUpdate': 0, 'Runtime': 'container'}}
_____________ ServiceTest.test_update_service_with_network_change ______________
tests/integration/api_service_test.py:1333: in test_update_service_with_network_change
    assert 'Networks' in svc_info['Spec']
E   AssertionError: assert 'Networks' in {'Labels': {}, 'Mode': {'Replicated': {'Replicas': 1}}, 'Name': 'dockerpytest_d4e23667cdbaf159', 'TaskTemplate': {'Con... {'Command': ['echo', 'hello'], 'Image': 'busybox', 'Isolation': 'default'}, 'ForceUpdate': 0, 'Runtime': 'container'}}
------- generated xml file: /src/bundles/test-docker-py/junit-report.xml -------
=========================== short test summary info ============================

@thaJeztah
Copy link
Member Author

@thaJeztah thaJeztah added the release-blocker PRs we want to block a release on label Oct 16, 2025
@thaJeztah thaJeztah force-pushed the remove_servicespec_networks branch 2 times, most recently from 2ee8784 to 88a4607 Compare October 17, 2025 12:53
@thaJeztah
Copy link
Member Author

Nice! Looks like my PR works;

Screenshot 2025-10-17 at 15 12 46

This field was deprecated in [engine-api@5c4b684], which got vendored into
Moby in [moby/moby@8f7a8c7] (API v1.25), and wired up in [moby/moby@99a98cc].

[engine-api@5c4b684]: docker-archive-public/docker.engine-api@5c4b684
[moby/moby@8f7a8c7]: moby@8f7a8c7
[moby/moby@99a98cc]: moby@99a98cc

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the remove_servicespec_networks branch from 88a4607 to 5061d0a Compare October 17, 2025 20:20
@thaJeztah thaJeztah marked this pull request as ready for review October 17, 2025 23:57
Comment on lines +175 to +181
if versions.LessThan(cliVersion, "1.25") {
legacyResponse := make([]*compat.Wrapper, 0, len(services))
for _, s := range services {
legacyResponse = append(legacyResponse, backFillLegacyNetwork(s))
}
return httputils.WriteJSON(w, http.StatusOK, legacyResponse)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW, I opened this PR before we disabled API < v1.44 by default, but probably won't do harm to keep these for now, and we can rip them out once we fully drop those API versions.

@thaJeztah thaJeztah merged commit 2f09e6d into moby:master Oct 20, 2025
330 of 332 checks passed
@thaJeztah thaJeztah deleted the remove_servicespec_networks branch October 20, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API area/daemon Core Engine area/dependencies area/go-sdk area/swarm impact/deprecation impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code module/api release-blocker PRs we want to block a release on status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants