MCPcopy
hub / github.com/containerd/containerd / Update

Method Update

client/containerstore.go:124–142  ·  view source on GitHub ↗
(ctx context.Context, container containers.Container, fieldpaths ...string)

Source from the content-addressed store, hash-verified

122}
123
124func (r *remoteContainers) Update(ctx context.Context, container containers.Container, fieldpaths ...string) (containers.Container, error) {
125 var updateMask *ptypes.FieldMask
126 if len(fieldpaths) > 0 {
127 updateMask = &ptypes.FieldMask{
128 Paths: fieldpaths,
129 }
130 }
131
132 updated, err := r.client.Update(ctx, &containersapi.UpdateContainerRequest{
133 Container: containerToProto(&container),
134 UpdateMask: updateMask,
135 })
136 if err != nil {
137 return containers.Container{}, errgrpc.ToNative(err)
138 }
139
140 return containerFromProto(updated.Container), nil
141
142}
143
144func (r *remoteContainers) Delete(ctx context.Context, id string) error {
145 _, err := r.client.Delete(ctx, &containersapi.DeleteContainerRequest{

Callers

nothing calls this directly

Calls 3

containerToProtoFunction · 0.70
containerFromProtoFunction · 0.70
UpdateMethod · 0.65

Tested by

no test coverage detected