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

Method Update

client/image_store.go:81–101  ·  view source on GitHub ↗
(ctx context.Context, image images.Image, fieldpaths ...string)

Source from the content-addressed store, hash-verified

79}
80
81func (s *remoteImages) Update(ctx context.Context, image images.Image, fieldpaths ...string) (images.Image, error) {
82 var updateMask *ptypes.FieldMask
83 if len(fieldpaths) > 0 {
84 updateMask = &ptypes.FieldMask{
85 Paths: fieldpaths,
86 }
87 }
88 req := &imagesapi.UpdateImageRequest{
89 Image: imageToProto(&image),
90 UpdateMask: updateMask,
91 }
92 if tm := epoch.FromContext(ctx); tm != nil {
93 req.SourceDateEpoch = timestamppb.New(*tm)
94 }
95 updated, err := s.client.Update(ctx, req)
96 if err != nil {
97 return images.Image{}, errgrpc.ToNative(err)
98 }
99
100 return imageFromProto(updated.Image), nil
101}
102
103func (s *remoteImages) Delete(ctx context.Context, name string, opts ...images.DeleteOpt) error {
104 var do images.DeleteOptions

Callers

nothing calls this directly

Calls 4

FromContextFunction · 0.92
imageToProtoFunction · 0.70
imageFromProtoFunction · 0.70
UpdateMethod · 0.65

Tested by

no test coverage detected