GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — api/types/network: separate Summary from Inspect by corhere · Pull Request #50878 · moby/moby

Conversation

@corhere

@corhere corhere commented Sep 2, 2025 •
edited by vvoland
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Stacked on top of daemon: filter networks before converting to API types #50860

- What I did
I made network.Summary and network.Inspect distinct types so they can be extended independently.

- How I did it

  • Moved all fields common to both GET /networks (List Networks) and GET /networks/{id} (Inspect Network) API endpoints into a base network.Network struct.
  • Changed network.Summary and network.Inspect to distinct struct types which both embed network.Network
  • Added backend methods which return []network.Summary, distinct from the existing []network.Inspect methods

- How to verify it

- Human readable description for the release notes

- Types `"github.com/moby/moby/api/types/network".Summary` and `"github.com/moby/moby/api/types/network".Inspect` are no longer aliases, and most of their fields have been moved into an embedded struct. Engine API clients may require some source-level changes when migrating to the new github.com/moby/moby/api module.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thompson-shaun reacted with eyes emoji
All reactions
  • 👀 1 reaction
@corhere corhere added this to the 29.0.0 milestone Sep 2, 2025
@corhere corhere added area/api API area/networking Networking impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK release-blocker PRs we want to block a release on labels Sep 2, 2025
@corhere
corhere requested a review from thaJeztah September 2, 2025 20:31
@corhere corhere added the kind/refactor PR's that refactor, or clean-up code label Sep 2, 2025
@thompson-shaun thompson-shaun assigned akerouanton and robmry Sep 3, 2025
@thompson-shaun
thompson-shaun requested review from akerouanton and robmry September 3, 2025 18:18
@robmry

robmry commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

thompson-shaun assigned akerouanton
thompson-shaun assigned robmry
thompson-shaun requested review from akerouanton and robmry

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.

thompson-shaun reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thompson-shaun thompson-shaun added this to 🔦 Maintainer spotlight Sep 4, 2025
@github-project-automation github-project-automation Bot moved this to New in 🔦 Maintainer spotlight Sep 4, 2025
@corhere
corhere force-pushed the network-inspect-concrete-type branch from 4358262 to c1c83d3 Compare September 4, 2025 16:55
@corhere
api/types/network: separate Summary from Inspect
1a86389
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 <[email protected]>
@corhere
corhere force-pushed the network-inspect-concrete-type branch from c1c83d3 to 1a86389 Compare September 4, 2025 17:51
@corhere
corhere marked this pull request as ready for review September 4, 2025 17:51
robmry
robmry approved these changes Sep 4, 2025
View reviewed changes
thaJeztah
thaJeztah approved these changes Sep 4, 2025
View reviewed changes

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM, thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread api/types/network/network.go
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)

@thaJeztah thaJeztah Sep 4, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

For a follow-up; considering if we want to define (typed) consts for Scope

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@thaJeztah
thaJeztah merged commit 6da8589 into moby:master Sep 4, 2025
This was referenced Sep 5, 2025
Prepare release notes for api/v1.52.0-beta.0 #50904
Merged
Prepare release notes for client/v0.1.0-beta.0 #50913
Merged
Prepare release notes for v2.0.0-beta.0 #50918
Merged
@thompson-shaun thompson-shaun moved this from New to Complete in 🔦 Maintainer spotlight Sep 11, 2025
@dmcgowan dmcgowan mentioned this pull request Sep 24, 2025
Prepare release notes for api/v1.52.0-rc.0 #51030
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@thaJeztah thaJeztah thaJeztah approved these changes
@robmry robmry robmry approved these changes
@akerouanton akerouanton Awaiting requested review from akerouanton

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@akerouanton akerouanton

@robmry robmry

Labels

area/api API area/networking Networking impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code release-blocker PRs we want to block a release on

Projects

🔦 Maintainer spotlight
Archived in project

Milestone

29.0.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@corhere @robmry @thaJeztah @akerouanton
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.