Files
podman/vendor/github.com/fsouza/go-dockerclient/container_update.go
tomsweeneyredhat c72102d1b2 Bump Buidah to v1.42.0 for Podman v5.7
Vendor Buildah v1.42.0 into Podman for v5.7.0.
This will also drag in:

go.podman.io/common v0.66.0
go.podman.io/image v5.38.0
go.podman.io/storage v1.61.0

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-10-22 13:51:32 -04:00

44 lines
1.4 KiB
Go

package docker
import (
"context"
"fmt"
"net/http"
)
// UpdateContainerOptions specify parameters to the UpdateContainer function.
//
// See https://goo.gl/Y6fXUy for more details.
type UpdateContainerOptions struct {
BlkioWeight int `json:"BlkioWeight"`
CPUShares int `json:"CpuShares"`
CPUPeriod int `json:"CpuPeriod"`
CPURealtimePeriod int64 `json:"CpuRealtimePeriod"`
CPURealtimeRuntime int64 `json:"CpuRealtimeRuntime"`
CPUQuota int `json:"CpuQuota"`
CpusetCpus string `json:"CpusetCpus"`
CpusetMems string `json:"CpusetMems"`
Memory int `json:"Memory"`
MemorySwap int `json:"MemorySwap"`
MemoryReservation int `json:"MemoryReservation"`
KernelMemory int `json:"KernelMemory"`
RestartPolicy RestartPolicy `json:"RestartPolicy,omitempty"`
Context context.Context
}
// UpdateContainer updates the container at ID with the options
//
// See https://goo.gl/Y6fXUy for more details.
func (c *Client) UpdateContainer(id string, opts UpdateContainerOptions) error {
resp, err := c.do(http.MethodPost, fmt.Sprintf("/containers/%s/update", id), doOptions{
data: opts,
forceJSON: true,
context: opts.Context,
})
if err != nil {
return err
}
defer resp.Body.Close()
return nil
}