mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client/image_build: Rename output to ImageBuildResult
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
committed by
Austin Vazquez
parent
13374b5a72
commit
51ed1a9a37
@@ -105,7 +105,7 @@ type DistributionAPIClient interface {
|
||||
|
||||
// ImageAPIClient defines API client methods for the images
|
||||
type ImageAPIClient interface {
|
||||
ImageBuild(ctx context.Context, context io.Reader, options ImageBuildOptions) (ImageBuildResponse, error)
|
||||
ImageBuild(ctx context.Context, context io.Reader, options ImageBuildOptions) (ImageBuildResult, error)
|
||||
BuildCachePrune(ctx context.Context, opts BuildCachePruneOptions) (BuildCachePruneResult, error)
|
||||
BuildCancel(ctx context.Context, id string, opts BuildCancelOptions) error
|
||||
ImageCreate(ctx context.Context, parentReference string, options ImageCreateOptions) (io.ReadCloser, error)
|
||||
|
||||
@@ -17,15 +17,15 @@ import (
|
||||
// ImageBuild sends a request to the daemon to build images.
|
||||
// The Body in the response implements an [io.ReadCloser] and it's up to the caller to
|
||||
// close it.
|
||||
func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options ImageBuildOptions) (ImageBuildResponse, error) {
|
||||
func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options ImageBuildOptions) (ImageBuildResult, error) {
|
||||
query, err := cli.imageBuildOptionsToQuery(ctx, options)
|
||||
if err != nil {
|
||||
return ImageBuildResponse{}, err
|
||||
return ImageBuildResult{}, err
|
||||
}
|
||||
|
||||
buf, err := json.Marshal(options.AuthConfigs)
|
||||
if err != nil {
|
||||
return ImageBuildResponse{}, err
|
||||
return ImageBuildResult{}, err
|
||||
}
|
||||
|
||||
headers := http.Header{}
|
||||
@@ -34,10 +34,10 @@ func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, optio
|
||||
|
||||
resp, err := cli.postRaw(ctx, "/build", query, buildContext, headers)
|
||||
if err != nil {
|
||||
return ImageBuildResponse{}, err
|
||||
return ImageBuildResult{}, err
|
||||
}
|
||||
|
||||
return ImageBuildResponse{
|
||||
return ImageBuildResult{
|
||||
Body: resp.Body,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ type ImageBuildOutput struct {
|
||||
Attrs map[string]string
|
||||
}
|
||||
|
||||
// ImageBuildResponse holds information
|
||||
// ImageBuildResult holds information
|
||||
// returned by a server after building
|
||||
// an image.
|
||||
type ImageBuildResponse struct {
|
||||
type ImageBuildResult struct {
|
||||
Body io.ReadCloser
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user