Rename Size_ to Size
Previouslty "Size" was reserved by protoc-gen-gogoctrd and user-generated "Size" was automatically renamed to "Size_" to avoid conflicts. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
parent
e3db7de8f5
commit
1a095e18ba
@ -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,
|
||||
|
@ -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.
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
4
diff.go
4
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,
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
2
task.go
2
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,
|
||||
|
@ -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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user