api/types/network: separate Summary from Inspect#50878
Merged
thaJeztah merged 1 commit intomoby:masterfrom Sep 4, 2025
Merged
Conversation
Contributor
It's not ready for review yet ... it's stacked on #50860, which needs a second review. As this one is a release blocker, I've marked the other as a release blocker too. |
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>
c1c83d3 to
1a86389
Compare
robmry
approved these changes
Sep 4, 2025
thaJeztah
approved these changes
Sep 4, 2025
| Name string // Name is the name of the network | ||
| ID string `json:"Id"` // ID uniquely identifies a network on a single machine | ||
| Created time.Time // Created is the time the network created | ||
| Scope string // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level) |
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)