mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-24 09:20:31 +00:00
23 lines
658 B
Go
23 lines
658 B
Go
|
package docker // import "docker.io/go-docker"
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
|
||
|
"docker.io/go-docker/api/types/container"
|
||
|
"golang.org/x/net/context"
|
||
|
)
|
||
|
|
||
|
// ContainerUpdate updates resources of a container
|
||
|
func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) {
|
||
|
var response container.ContainerUpdateOKBody
|
||
|
serverResp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil)
|
||
|
if err != nil {
|
||
|
return response, err
|
||
|
}
|
||
|
|
||
|
err = json.NewDecoder(serverResp.body).Decode(&response)
|
||
|
|
||
|
ensureReaderClosed(serverResp)
|
||
|
return response, err
|
||
|
}
|