client: refactor ContainerRename to wrap options/result structs#51315
Merged
thaJeztah merged 1 commit intomoby:masterfrom Oct 29, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the ContainerRename API to use structured options and result types instead of simple string parameters, improving API consistency and enabling future extensibility.
- Introduces
ContainerRenameOptionsandContainerRenameResultstructs to wrap input parameters and return values - Updates the
ContainerRenamemethod signature to accept options struct and return result struct - Updates all test files to use the new API structure
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| client/container_rename.go | Defines new options/result structs and refactors the main ContainerRename implementation |
| client/client_interfaces.go | Updates the ContainerAPIClient interface to match the new method signature |
| client/container_rename_test.go | Updates unit tests to use the new structured API |
| integration/container/rename_test.go | Updates integration tests to use the new structured API and handle return values |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
thaJeztah
reviewed
Oct 29, 2025
client/container_rename.go
Outdated
|
|
||
| // ContainerRenameOptions represents the options for renaming a container. | ||
| type ContainerRenameOptions struct { | ||
| NewContainerName string |
Member
There was a problem hiding this comment.
Perhaps NewName would work for this; slightly shorter.
Let me push an update.
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
721c473 to
d2e7465
Compare
vvoland
approved these changes
Oct 29, 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
#50965
This change refactors client
ContainerRenameimplementation to take client module defined options and result structs to decouple the client module from API changes.- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)