Browse code

client/build_cancel: Add options struct

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>

Paweł Gronowski authored on 2025/10/01 19:50:39
Showing 4 changed files
... ...
@@ -5,9 +5,11 @@ import (
5 5
 	"net/url"
6 6
 )
7 7
 
8
+type BuildCancelOptions struct{}
9
+
8 10
 // BuildCancel requests the daemon to cancel the ongoing build request
9 11
 // with the given id.
10
-func (cli *Client) BuildCancel(ctx context.Context, id string) error {
12
+func (cli *Client) BuildCancel(ctx context.Context, id string, _ BuildCancelOptions) error {
11 13
 	query := url.Values{}
12 14
 	query.Set("id", id)
13 15
 
... ...
@@ -110,7 +110,7 @@ type DistributionAPIClient interface {
110 110
 type ImageAPIClient interface {
111 111
 	ImageBuild(ctx context.Context, context io.Reader, options ImageBuildOptions) (ImageBuildResponse, error)
112 112
 	BuildCachePrune(ctx context.Context, opts BuildCachePruneOptions) (*build.CachePruneReport, error)
113
-	BuildCancel(ctx context.Context, id string) error
113
+	BuildCancel(ctx context.Context, id string, opts BuildCancelOptions) error
114 114
 	ImageCreate(ctx context.Context, parentReference string, options ImageCreateOptions) (io.ReadCloser, error)
115 115
 	ImageImport(ctx context.Context, source ImageImportSource, ref string, options ImageImportOptions) (io.ReadCloser, error)
116 116
 
... ...
@@ -5,9 +5,11 @@ import (
5 5
 	"net/url"
6 6
 )
7 7
 
8
+type BuildCancelOptions struct{}
9
+
8 10
 // BuildCancel requests the daemon to cancel the ongoing build request
9 11
 // with the given id.
10
-func (cli *Client) BuildCancel(ctx context.Context, id string) error {
12
+func (cli *Client) BuildCancel(ctx context.Context, id string, _ BuildCancelOptions) error {
11 13
 	query := url.Values{}
12 14
 	query.Set("id", id)
13 15
 
... ...
@@ -110,7 +110,7 @@ type DistributionAPIClient interface {
110 110
 type ImageAPIClient interface {
111 111
 	ImageBuild(ctx context.Context, context io.Reader, options ImageBuildOptions) (ImageBuildResponse, error)
112 112
 	BuildCachePrune(ctx context.Context, opts BuildCachePruneOptions) (*build.CachePruneReport, error)
113
-	BuildCancel(ctx context.Context, id string) error
113
+	BuildCancel(ctx context.Context, id string, opts BuildCancelOptions) error
114 114
 	ImageCreate(ctx context.Context, parentReference string, options ImageCreateOptions) (io.ReadCloser, error)
115 115
 	ImageImport(ctx context.Context, source ImageImportSource, ref string, options ImageImportOptions) (io.ReadCloser, error)
116 116