mirror of
https://github.com/moby/moby.git
synced 2025-07-30 18:23:29 +03:00
Use IDResponse for container create response.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
@ -12,16 +12,16 @@ import (
|
||||
)
|
||||
|
||||
// ContainerCommit applies changes into a container and creates a new tagged image.
|
||||
func (cli *Client) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.ContainerCommitResponse, error) {
|
||||
func (cli *Client) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) {
|
||||
var repository, tag string
|
||||
if options.Reference != "" {
|
||||
distributionRef, err := distreference.ParseNamed(options.Reference)
|
||||
if err != nil {
|
||||
return types.ContainerCommitResponse{}, err
|
||||
return types.IDResponse{}, err
|
||||
}
|
||||
|
||||
if _, isCanonical := distributionRef.(distreference.Canonical); isCanonical {
|
||||
return types.ContainerCommitResponse{}, errors.New("refusing to create a tag with a digest reference")
|
||||
return types.IDResponse{}, errors.New("refusing to create a tag with a digest reference")
|
||||
}
|
||||
|
||||
tag = reference.GetTagFromNamedRef(distributionRef)
|
||||
@ -41,7 +41,7 @@ func (cli *Client) ContainerCommit(ctx context.Context, container string, option
|
||||
query.Set("pause", "0")
|
||||
}
|
||||
|
||||
var response types.ContainerCommitResponse
|
||||
var response types.IDResponse
|
||||
resp, err := cli.post(ctx, "/commit", query, options.Config, nil)
|
||||
if err != nil {
|
||||
return response, err
|
||||
|
Reference in New Issue
Block a user