mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-25 03:26:54 -05:00
Bumps [github.com/testcontainers/testcontainers-go/modules/opensearch](https://github.com/testcontainers/testcontainers-go) from 0.38.0 to 0.39.0. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.38.0...v0.39.0) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go/modules/opensearch dependency-version: 0.39.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
27 lines
726 B
Go
27 lines
726 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
|
|
"github.com/docker/docker/api/types/container"
|
|
)
|
|
|
|
// ContainerUpdate updates the resources of a container.
|
|
func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.UpdateResponse, error) {
|
|
containerID, err := trimID("container", containerID)
|
|
if err != nil {
|
|
return container.UpdateResponse{}, err
|
|
}
|
|
|
|
resp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil)
|
|
defer ensureReaderClosed(resp)
|
|
if err != nil {
|
|
return container.UpdateResponse{}, err
|
|
}
|
|
|
|
var response container.UpdateResponse
|
|
err = json.NewDecoder(resp.Body).Decode(&response)
|
|
return response, err
|
|
}
|