Skip to content

Commit ad3cbfc

Browse files
committed
fix gogo/protobuf -> google.golang.org/protobuf
Signed-off-by: Akhil Mohan <[email protected]>
1 parent 3152233 commit ad3cbfc

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

container/containerd/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
"sync"
2323
"time"
2424

25-
ptypes "github.com/gogo/protobuf/types"
2625
"google.golang.org/grpc"
2726
"google.golang.org/grpc/backoff"
2827
"google.golang.org/grpc/credentials/insecure"
28+
emptypb "google.golang.org/protobuf/types/known/emptypb"
2929

3030
containersapi "github.com/containerd/containerd/api/services/containers/v1"
3131
tasksapi "github.com/containerd/containerd/api/services/tasks/v1"
@@ -126,22 +126,23 @@ func (c *client) TaskPid(ctx context.Context, id string) (uint32, error) {
126126
if err != nil {
127127
return 0, errdefs.FromGRPC(err)
128128
}
129-
if response.Process.Status == tasktypes.StatusUnknown {
129+
if response.Process.Status == tasktypes.Status_UNKNOWN {
130130
return 0, ErrTaskIsInUnknownState
131131
}
132132
return response.Process.Pid, nil
133133
}
134134

135135
func (c *client) Version(ctx context.Context) (string, error) {
136-
response, err := c.versionService.Version(ctx, &ptypes.Empty{})
136+
response, err := c.versionService.Version(ctx, &emptypb.Empty{})
137137
if err != nil {
138138
return "", errdefs.FromGRPC(err)
139139
}
140140
return response.Version, nil
141141
}
142142

143-
func containerFromProto(containerpb containersapi.Container) *containers.Container {
143+
func containerFromProto(containerpb *containersapi.Container) *containers.Container {
144144
var runtime containers.RuntimeInfo
145+
// TODO: is nil check required for containerpb
145146
if containerpb.Runtime != nil {
146147
runtime = containers.RuntimeInfo{
147148
Name: containerpb.Runtime.Name,

container/containerd/containers/containers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"context"
3434
"time"
3535

36-
"github.com/gogo/protobuf/types"
36+
anypb "google.golang.org/protobuf/types/known/anypb"
3737
)
3838

3939
// Container represents the set of data pinned by a container. Unless otherwise
@@ -66,7 +66,7 @@ type Container struct {
6666
// container.
6767
//
6868
// This field is required but mutable.
69-
Spec *types.Any
69+
Spec *anypb.Any
7070

7171
// SnapshotKey specifies the snapshot key to use for the container's root
7272
// filesystem. When starting a task from this container, a caller should
@@ -88,13 +88,13 @@ type Container struct {
8888
UpdatedAt time.Time
8989

9090
// Extensions stores client-specified metadata
91-
Extensions map[string]types.Any
91+
Extensions map[string]*anypb.Any
9292
}
9393

9494
// RuntimeInfo holds runtime specific information
9595
type RuntimeInfo struct {
9696
Name string
97-
Options *types.Any
97+
Options *anypb.Any
9898
}
9999

100100
// Store interacts with the underlying container storage

0 commit comments

Comments
 (0)