Skip to content

client: rewrite prune functions to use option structs and result#51200

Merged
thaJeztah merged 4 commits intomoby:masterfrom
thaJeztah:prune_option_structs
Oct 16, 2025
Merged

client: rewrite prune functions to use option structs and result#51200
thaJeztah merged 4 commits intomoby:masterfrom
thaJeztah:prune_option_structs

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Oct 16, 2025

client: rewrite prune functions to use option structs and result

  • client: ContainersPrune: rewrite to use option structs and result
  • client: ImagesPrune: rewrite to use option structs and result
  • client: NetworksPrune: rewrite to use option structs and result
  • client: VolumesPrune: rewrite to use option structs and result

- Human readable description for the release notes

client: ContainersPrune: rewrite to use option structs and result
client: ImagesPrune: rewrite to use option structs and result
client: NetworksPrune: rewrite to use option structs and result
client: VolumesPrune: rewrite to use option structs and result

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 29.0.0 milestone Oct 16, 2025
@thaJeztah thaJeztah added status/2-code-review impact/changelog kind/refactor PR's that refactor, or clean-up code area/go-sdk impact/go-sdk Noteworthy (compatibility changes) in the Go SDK release-blocker PRs we want to block a release on module/client labels Oct 16, 2025
@thaJeztah thaJeztah marked this pull request as ready for review October 16, 2025 11:48
@thaJeztah thaJeztah requested review from robmry and vvoland October 16, 2025 11:59
Copy link
Member

@akerouanton akerouanton left a comment

Choose a reason for hiding this comment

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

Left one question but nothing harmful. LGTM

defer d.Stop(t)

apiClient := d.NewClientT(t)
defer apiClient.Close()
Copy link
Member

Choose a reason for hiding this comment

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

Why drop these?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh! Right, my IDE kept being noisy about unhandled errors, and in this case NewClientT already handles closing;

func (d *Daemon) NewClientT(t testing.TB, extraOpts ...client.Opt) *client.Client {
t.Helper()
c, err := d.NewClient(extraOpts...)
assert.NilError(t, err, "[%s] could not create daemon client", d.id)
t.Cleanup(func() { c.Close() })
return c
}

@thaJeztah thaJeztah merged commit f6e52c8 into moby:master Oct 16, 2025
205 of 206 checks passed
@thaJeztah thaJeztah deleted the prune_option_structs branch October 16, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dependencies area/go-sdk area/images Image Distribution area/volumes Volumes impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code module/client 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.

3 participants