{{ message }}
Repository navigation
api/types/network: separate Summary from Inspect - #50878
Merged
Merged
Conversation
Contributor
corhere
force-pushed
the
network-inspect-concrete-type
branch
from
September 4, 2025 16:55
4358262 to
c1c83d3
Compare
While the network Summary and Inspect types have been aliases in Go's type system, in practice there is a difference: the Containers and Services fields are only populated when inspecting a network. Split out the common fields into a base network.Network struct which is embedded in the network.Summary and network.Inspect types. Signed-off-by: Cory Snider <csnider@mirantis.com>
corhere
force-pushed
the
network-inspect-concrete-type
branch
from
September 4, 2025 17:51
c1c83d3 to
1a86389
Compare
corhere
marked this pull request as ready for review
September 4, 2025 17:51
robmry
approved these changes
Sep 4, 2025
thaJeztah
approved these changes
Sep 4, 2025
Member
There was a problem hiding this comment.
For a follow-up; considering if we want to define (typed) consts for Scope
This was referenced Sep 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

- What I did
I made network.Summary and network.Inspect distinct types so they can be extended independently.
- How I did it
GET /networks(List Networks) andGET /networks/{id}(Inspect Network) API endpoints into a basenetwork.Networkstruct.network.Summaryandnetwork.Inspectto distinct struct types which both embednetwork.Network[]network.Summary, distinct from the existing[]network.Inspectmethods- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)