diff --git a/container_checkpoint_opts.go b/container_checkpoint_opts.go index 915a30e0707d..64f23823d280 100644 --- a/container_checkpoint_opts.go +++ b/container_checkpoint_opts.go @@ -73,7 +73,7 @@ func WithCheckpointTask(ctx context.Context, client *Client, c *containers.Conta platformSpec := platforms.DefaultSpec() index.Manifests = append(index.Manifests, imagespec.Descriptor{ MediaType: d.MediaType, - Size: d.Size_, + Size: d.Size, Digest: digest.Digest(d.Digest), Platform: &platformSpec, Annotations: d.Annotations, diff --git a/content/proxy/content_reader.go b/content/proxy/content_reader.go index c8fa50827633..893e3b0f23df 100644 --- a/content/proxy/content_reader.go +++ b/content/proxy/content_reader.go @@ -38,7 +38,7 @@ func (ra *remoteReaderAt) ReadAt(p []byte, off int64) (n int, err error) { rr := &contentapi.ReadContentRequest{ Digest: ra.digest.String(), Offset: off, - Size_: int64(len(p)), + Size: int64(len(p)), } // we need a child context with cancel, or the eventually called // grpc.NewStream will leak the goroutine until the whole thing is cleared. diff --git a/content/proxy/content_store.go b/content/proxy/content_store.go index 374e260bdb20..8e7fb42cf0a5 100644 --- a/content/proxy/content_store.go +++ b/content/proxy/content_store.go @@ -217,7 +217,7 @@ func (pcs *proxyContentStore) negotiate(ctx context.Context, ref string, size in func infoToGRPC(info *content.Info) *contentapi.Info { return &contentapi.Info{ Digest: info.Digest.String(), - Size_: info.Size, + Size: info.Size, CreatedAt: protobuf.ToTimestamp(info.CreatedAt), UpdatedAt: protobuf.ToTimestamp(info.UpdatedAt), Labels: info.Labels, @@ -227,7 +227,7 @@ func infoToGRPC(info *content.Info) *contentapi.Info { func infoFromGRPC(info *contentapi.Info) content.Info { return content.Info{ Digest: digest.Digest(info.Digest), - Size: info.Size_, + Size: info.Size, CreatedAt: protobuf.FromTimestamp(info.CreatedAt), UpdatedAt: protobuf.FromTimestamp(info.UpdatedAt), Labels: info.Labels, diff --git a/contrib/snapshotservice/service.go b/contrib/snapshotservice/service.go index 0f411ae082f0..7e982fde8229 100644 --- a/contrib/snapshotservice/service.go +++ b/contrib/snapshotservice/service.go @@ -161,7 +161,7 @@ func (s service) Usage(ctx context.Context, ur *snapshotsapi.UsageRequest) (*sna return &snapshotsapi.UsageResponse{ Inodes: usage.Inodes, - Size_: usage.Size, + Size: usage.Size, }, nil } diff --git a/diff.go b/diff.go index 5e79d9ced3c1..acb7e44ff0fb 100644 --- a/diff.go +++ b/diff.go @@ -98,7 +98,7 @@ func toDescriptor(d *types.Descriptor) ocispec.Descriptor { return ocispec.Descriptor{ MediaType: d.MediaType, Digest: digest.Digest(d.Digest), - Size: d.Size_, + Size: d.Size, Annotations: d.Annotations, } } @@ -107,7 +107,7 @@ func fromDescriptor(d ocispec.Descriptor) *types.Descriptor { return &types.Descriptor{ MediaType: d.MediaType, Digest: d.Digest.String(), - Size_: d.Size, + Size: d.Size, Annotations: d.Annotations, } } diff --git a/image_store.go b/image_store.go index 044a8a6b2f43..856d6d6b4f77 100644 --- a/image_store.go +++ b/image_store.go @@ -141,7 +141,7 @@ func imagesFromProto(imagespb []*imagesapi.Image) []images.Image { func descFromProto(desc *types.Descriptor) ocispec.Descriptor { return ocispec.Descriptor{ MediaType: desc.MediaType, - Size: desc.Size_, + Size: desc.Size, Digest: digest.Digest(desc.Digest), Annotations: desc.Annotations, } @@ -150,7 +150,7 @@ func descFromProto(desc *types.Descriptor) ocispec.Descriptor { func descToProto(desc *ocispec.Descriptor) *types.Descriptor { return &types.Descriptor{ MediaType: desc.MediaType, - Size_: desc.Size, + Size: desc.Size, Digest: desc.Digest.String(), Annotations: desc.Annotations, } diff --git a/integration/remote/remote_image.go b/integration/remote/remote_image.go index 16088a9e4886..ad2b04e78b4f 100644 --- a/integration/remote/remote_image.go +++ b/integration/remote/remote_image.go @@ -111,7 +111,7 @@ func (r *ImageService) ImageStatus(image *runtimeapi.ImageSpec, opts ...grpc.Cal } if resp.Image != nil { - if resp.Image.Id == "" || resp.Image.Size_ == 0 { + if resp.Image.Id == "" || resp.Image.Size() == 0 { errorMessage := fmt.Sprintf("Id or size of image %q is not set", image.Image) klog.Errorf("ImageStatus failed: %s", errorMessage) return nil, errors.New(errorMessage) diff --git a/services/content/contentserver/contentserver.go b/services/content/contentserver/contentserver.go index 30395a6e3041..c3c895d6d62e 100644 --- a/services/content/contentserver/contentserver.go +++ b/services/content/contentserver/contentserver.go @@ -104,7 +104,7 @@ func (s *service) List(req *api.ListContentRequest, session api.Content_ListServ if err := s.store.Walk(session.Context(), func(info content.Info) error { buffer = append(buffer, &api.Info{ Digest: info.Digest.String(), - Size_: info.Size, + Size: info.Size, CreatedAt: protobuf.ToTimestamp(info.CreatedAt), Labels: info.Labels, }) @@ -167,7 +167,7 @@ func (s *service) Read(req *api.ReadContentRequest, session api.Content_ReadServ offset = req.Offset // size is read size, not the expected size of the blob (oi.Size), which the caller might not be aware of. // offset+size can be larger than oi.Size. - size = req.Size_ + size = req.Size // TODO(stevvooe): Using the global buffer pool. At 32KB, it is probably // little inefficient for work over a fast network. We can tune this later. @@ -456,7 +456,7 @@ func (s *service) Abort(ctx context.Context, req *api.AbortRequest) (*ptypes.Emp func infoToGRPC(info content.Info) *api.Info { return &api.Info{ Digest: info.Digest.String(), - Size_: info.Size, + Size: info.Size, CreatedAt: protobuf.ToTimestamp(info.CreatedAt), UpdatedAt: protobuf.ToTimestamp(info.UpdatedAt), Labels: info.Labels, @@ -466,7 +466,7 @@ func infoToGRPC(info content.Info) *api.Info { func infoFromGRPC(info *api.Info) content.Info { return content.Info{ Digest: digest.Digest(info.Digest), - Size: info.Size_, + Size: info.Size, CreatedAt: protobuf.FromTimestamp(info.CreatedAt), UpdatedAt: protobuf.FromTimestamp(info.UpdatedAt), Labels: info.Labels, diff --git a/services/diff/local.go b/services/diff/local.go index d71557921e79..eadbd31784e7 100644 --- a/services/diff/local.go +++ b/services/diff/local.go @@ -177,7 +177,7 @@ func toDescriptor(d *types.Descriptor) ocispec.Descriptor { return ocispec.Descriptor{ MediaType: d.MediaType, Digest: digest.Digest(d.Digest), - Size: d.Size_, + Size: d.Size, Annotations: d.Annotations, } } @@ -186,7 +186,7 @@ func fromDescriptor(d ocispec.Descriptor) *types.Descriptor { return &types.Descriptor{ MediaType: d.MediaType, Digest: d.Digest.String(), - Size_: d.Size, + Size: d.Size, Annotations: d.Annotations, } } diff --git a/services/images/helpers.go b/services/images/helpers.go index d744cb7b8636..43712212efb8 100644 --- a/services/images/helpers.go +++ b/services/images/helpers.go @@ -59,7 +59,7 @@ func imageFromProto(imagepb *imagesapi.Image) images.Image { func descFromProto(desc *types.Descriptor) ocispec.Descriptor { return ocispec.Descriptor{ MediaType: desc.MediaType, - Size: desc.Size_, + Size: desc.Size, Digest: digest.Digest(desc.Digest), Annotations: desc.Annotations, } @@ -68,7 +68,7 @@ func descFromProto(desc *types.Descriptor) ocispec.Descriptor { func descToProto(desc *ocispec.Descriptor) *types.Descriptor { return &types.Descriptor{ MediaType: desc.MediaType, - Size_: desc.Size, + Size: desc.Size, Digest: desc.Digest.String(), Annotations: desc.Annotations, } diff --git a/services/snapshots/service.go b/services/snapshots/service.go index 3bc3a1c179a0..a63d3f88041d 100644 --- a/services/snapshots/service.go +++ b/services/snapshots/service.go @@ -300,7 +300,7 @@ func fromInfo(info snapshots.Info) *snapshotsapi.Info { func fromUsage(usage snapshots.Usage) *snapshotsapi.UsageResponse { return &snapshotsapi.UsageResponse{ Inodes: usage.Inodes, - Size_: usage.Size, + Size: usage.Size, } } diff --git a/services/tasks/local.go b/services/tasks/local.go index f44df1544c18..986878385a12 100644 --- a/services/tasks/local.go +++ b/services/tasks/local.go @@ -177,7 +177,7 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc. reader, err := l.store.ReaderAt(ctx, ocispec.Descriptor{ MediaType: r.Checkpoint.MediaType, Digest: digest.Digest(r.Checkpoint.Digest), - Size: r.Checkpoint.Size_, + Size: r.Checkpoint.Size, Annotations: r.Checkpoint.Annotations, }) if err != nil { @@ -694,7 +694,7 @@ func (l *local) writeContent(ctx context.Context, mediaType, ref string, r io.Re return &types.Descriptor{ MediaType: mediaType, Digest: writer.Digest().String(), - Size_: size, + Size: size, Annotations: make(map[string]string), }, nil } diff --git a/snapshots/proxy/proxy.go b/snapshots/proxy/proxy.go index a71b0856e9f3..b6045ce15a14 100644 --- a/snapshots/proxy/proxy.go +++ b/snapshots/proxy/proxy.go @@ -216,7 +216,7 @@ func toInfo(info *snapshotsapi.Info) snapshots.Info { func toUsage(resp *snapshotsapi.UsageResponse) snapshots.Usage { return snapshots.Usage{ Inodes: resp.Inodes, - Size: resp.Size_, + Size: resp.Size, } } diff --git a/task.go b/task.go index a6e713cc6ba3..d642dfc40310 100644 --- a/task.go +++ b/task.go @@ -604,7 +604,7 @@ func (t *task) checkpointTask(ctx context.Context, index *v1.Index, request *tas for _, d := range response.Descriptors { index.Manifests = append(index.Manifests, v1.Descriptor{ MediaType: d.MediaType, - Size: d.Size_, + Size: d.Size, Digest: digest.Digest(d.Digest), Platform: &v1.Platform{ OS: goruntime.GOOS, diff --git a/task_opts.go b/task_opts.go index 4315b212b72d..e372ca4451e0 100644 --- a/task_opts.go +++ b/task_opts.go @@ -69,7 +69,7 @@ func WithTaskCheckpoint(im Image) NewTaskOpts { if m.MediaType == images.MediaTypeContainerd1Checkpoint { info.Checkpoint = &types.Descriptor{ MediaType: m.MediaType, - Size_: m.Size, + Size: m.Size, Digest: m.Digest.String(), Annotations: m.Annotations, }