From 875c5777113ac291f6d474a0304eb33a535785af Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 24 Oct 2025 13:03:21 +0200 Subject: [PATCH] client: consolidate node options with their methods Move them together, as we did for most of the other options. Signed-off-by: Sebastiaan van Stijn --- client/node_inspect.go | 3 +++ client/node_list.go | 5 +++++ client/node_remove.go | 4 ++++ client/node_update.go | 8 ++++++++ client/swarm_node_inspect_opts.go | 4 ---- client/swarm_node_list_opts.go | 6 ------ client/swarm_node_remove_opts.go | 6 ------ client/swarm_node_update_opts.go | 9 --------- vendor/github.com/moby/moby/client/container_exec.go | 4 ++-- vendor/github.com/moby/moby/client/node_inspect.go | 3 +++ vendor/github.com/moby/moby/client/node_list.go | 5 +++++ vendor/github.com/moby/moby/client/node_remove.go | 4 ++++ vendor/github.com/moby/moby/client/node_update.go | 8 ++++++++ .../moby/moby/client/swarm_node_inspect_opts.go | 4 ---- .../github.com/moby/moby/client/swarm_node_list_opts.go | 6 ------ .../moby/moby/client/swarm_node_remove_opts.go | 6 ------ .../moby/moby/client/swarm_node_update_opts.go | 9 --------- 17 files changed, 42 insertions(+), 52 deletions(-) delete mode 100644 client/swarm_node_inspect_opts.go delete mode 100644 client/swarm_node_list_opts.go delete mode 100644 client/swarm_node_remove_opts.go delete mode 100644 client/swarm_node_update_opts.go delete mode 100644 vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go delete mode 100644 vendor/github.com/moby/moby/client/swarm_node_list_opts.go delete mode 100644 vendor/github.com/moby/moby/client/swarm_node_remove_opts.go delete mode 100644 vendor/github.com/moby/moby/client/swarm_node_update_opts.go diff --git a/client/node_inspect.go b/client/node_inspect.go index b6ba94fb6e..2fee09fd5e 100644 --- a/client/node_inspect.go +++ b/client/node_inspect.go @@ -9,6 +9,9 @@ import ( "github.com/moby/moby/api/types/swarm" ) +// NodeInspectOptions holds parameters to inspect nodes with. +type NodeInspectOptions struct{} + type NodeInspectResult struct { Node swarm.Node Raw []byte diff --git a/client/node_list.go b/client/node_list.go index 6952d5fe2b..1a1b57922e 100644 --- a/client/node_list.go +++ b/client/node_list.go @@ -8,6 +8,11 @@ import ( "github.com/moby/moby/api/types/swarm" ) +// NodeListOptions holds parameters to list nodes with. +type NodeListOptions struct { + Filters Filters +} + type NodeListResult struct { Items []swarm.Node } diff --git a/client/node_remove.go b/client/node_remove.go index c7f6d7ea8a..56c39d67a6 100644 --- a/client/node_remove.go +++ b/client/node_remove.go @@ -5,6 +5,10 @@ import ( "net/url" ) +// NodeRemoveOptions holds parameters to remove nodes with. +type NodeRemoveOptions struct { + Force bool +} type NodeRemoveResult struct{} // NodeRemove removes a Node. diff --git a/client/node_update.go b/client/node_update.go index 8f9caa4411..dcf5b617ec 100644 --- a/client/node_update.go +++ b/client/node_update.go @@ -3,8 +3,16 @@ package client import ( "context" "net/url" + + "github.com/moby/moby/api/types/swarm" ) +// NodeUpdateOptions holds parameters to update nodes with. +type NodeUpdateOptions struct { + Version swarm.Version + Node swarm.NodeSpec +} + type NodeUpdateResult struct{} // NodeUpdate updates a Node. diff --git a/client/swarm_node_inspect_opts.go b/client/swarm_node_inspect_opts.go deleted file mode 100644 index 5423f5c67c..0000000000 --- a/client/swarm_node_inspect_opts.go +++ /dev/null @@ -1,4 +0,0 @@ -package client - -// NodeInspectOptions holds parameters to inspect nodes with. -type NodeInspectOptions struct{} diff --git a/client/swarm_node_list_opts.go b/client/swarm_node_list_opts.go deleted file mode 100644 index c5293cd174..0000000000 --- a/client/swarm_node_list_opts.go +++ /dev/null @@ -1,6 +0,0 @@ -package client - -// NodeListOptions holds parameters to list nodes with. -type NodeListOptions struct { - Filters Filters -} diff --git a/client/swarm_node_remove_opts.go b/client/swarm_node_remove_opts.go deleted file mode 100644 index 85bc12f812..0000000000 --- a/client/swarm_node_remove_opts.go +++ /dev/null @@ -1,6 +0,0 @@ -package client - -// NodeRemoveOptions holds parameters to remove nodes with. -type NodeRemoveOptions struct { - Force bool -} diff --git a/client/swarm_node_update_opts.go b/client/swarm_node_update_opts.go deleted file mode 100644 index 738b9f871f..0000000000 --- a/client/swarm_node_update_opts.go +++ /dev/null @@ -1,9 +0,0 @@ -package client - -import "github.com/moby/moby/api/types/swarm" - -// NodeUpdateOptions holds parameters to update nodes with. -type NodeUpdateOptions struct { - Version swarm.Version - Node swarm.NodeSpec -} diff --git a/vendor/github.com/moby/moby/client/container_exec.go b/vendor/github.com/moby/moby/client/container_exec.go index 3b23de487d..76e4d09871 100644 --- a/vendor/github.com/moby/moby/client/container_exec.go +++ b/vendor/github.com/moby/moby/client/container_exec.go @@ -26,7 +26,7 @@ type ExecCreateOptions struct { // ExecCreateResult holds the result of creating a container exec. type ExecCreateResult struct { - container.ExecCreateResponse + ID string } // ExecCreate creates a new exec configuration to run an exec process. @@ -58,7 +58,7 @@ func (cli *Client) ExecCreate(ctx context.Context, containerID string, options E var response container.ExecCreateResponse err = json.NewDecoder(resp.Body).Decode(&response) - return ExecCreateResult{ExecCreateResponse: response}, err + return ExecCreateResult{ID: response.ID}, err } type execStartAttachOptions struct { diff --git a/vendor/github.com/moby/moby/client/node_inspect.go b/vendor/github.com/moby/moby/client/node_inspect.go index b6ba94fb6e..2fee09fd5e 100644 --- a/vendor/github.com/moby/moby/client/node_inspect.go +++ b/vendor/github.com/moby/moby/client/node_inspect.go @@ -9,6 +9,9 @@ import ( "github.com/moby/moby/api/types/swarm" ) +// NodeInspectOptions holds parameters to inspect nodes with. +type NodeInspectOptions struct{} + type NodeInspectResult struct { Node swarm.Node Raw []byte diff --git a/vendor/github.com/moby/moby/client/node_list.go b/vendor/github.com/moby/moby/client/node_list.go index 6952d5fe2b..1a1b57922e 100644 --- a/vendor/github.com/moby/moby/client/node_list.go +++ b/vendor/github.com/moby/moby/client/node_list.go @@ -8,6 +8,11 @@ import ( "github.com/moby/moby/api/types/swarm" ) +// NodeListOptions holds parameters to list nodes with. +type NodeListOptions struct { + Filters Filters +} + type NodeListResult struct { Items []swarm.Node } diff --git a/vendor/github.com/moby/moby/client/node_remove.go b/vendor/github.com/moby/moby/client/node_remove.go index c7f6d7ea8a..56c39d67a6 100644 --- a/vendor/github.com/moby/moby/client/node_remove.go +++ b/vendor/github.com/moby/moby/client/node_remove.go @@ -5,6 +5,10 @@ import ( "net/url" ) +// NodeRemoveOptions holds parameters to remove nodes with. +type NodeRemoveOptions struct { + Force bool +} type NodeRemoveResult struct{} // NodeRemove removes a Node. diff --git a/vendor/github.com/moby/moby/client/node_update.go b/vendor/github.com/moby/moby/client/node_update.go index 8f9caa4411..dcf5b617ec 100644 --- a/vendor/github.com/moby/moby/client/node_update.go +++ b/vendor/github.com/moby/moby/client/node_update.go @@ -3,8 +3,16 @@ package client import ( "context" "net/url" + + "github.com/moby/moby/api/types/swarm" ) +// NodeUpdateOptions holds parameters to update nodes with. +type NodeUpdateOptions struct { + Version swarm.Version + Node swarm.NodeSpec +} + type NodeUpdateResult struct{} // NodeUpdate updates a Node. diff --git a/vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go b/vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go deleted file mode 100644 index 5423f5c67c..0000000000 --- a/vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go +++ /dev/null @@ -1,4 +0,0 @@ -package client - -// NodeInspectOptions holds parameters to inspect nodes with. -type NodeInspectOptions struct{} diff --git a/vendor/github.com/moby/moby/client/swarm_node_list_opts.go b/vendor/github.com/moby/moby/client/swarm_node_list_opts.go deleted file mode 100644 index c5293cd174..0000000000 --- a/vendor/github.com/moby/moby/client/swarm_node_list_opts.go +++ /dev/null @@ -1,6 +0,0 @@ -package client - -// NodeListOptions holds parameters to list nodes with. -type NodeListOptions struct { - Filters Filters -} diff --git a/vendor/github.com/moby/moby/client/swarm_node_remove_opts.go b/vendor/github.com/moby/moby/client/swarm_node_remove_opts.go deleted file mode 100644 index 85bc12f812..0000000000 --- a/vendor/github.com/moby/moby/client/swarm_node_remove_opts.go +++ /dev/null @@ -1,6 +0,0 @@ -package client - -// NodeRemoveOptions holds parameters to remove nodes with. -type NodeRemoveOptions struct { - Force bool -} diff --git a/vendor/github.com/moby/moby/client/swarm_node_update_opts.go b/vendor/github.com/moby/moby/client/swarm_node_update_opts.go deleted file mode 100644 index 738b9f871f..0000000000 --- a/vendor/github.com/moby/moby/client/swarm_node_update_opts.go +++ /dev/null @@ -1,9 +0,0 @@ -package client - -import "github.com/moby/moby/api/types/swarm" - -// NodeUpdateOptions holds parameters to update nodes with. -type NodeUpdateOptions struct { - Version swarm.Version - Node swarm.NodeSpec -}