kubelet/rktshim: update cri to protobuf v3

pull/6/head
Pengfei Ni 2017-01-20 09:55:19 +08:00
parent 76afc7300d
commit e77e61b3bb
2 changed files with 13 additions and 15 deletions

View File

@ -90,16 +90,14 @@ type fakeContainer struct {
func (c *fakeContainer) Start() {
c.State = runtimeapi.ContainerState_CONTAINER_RUNNING
c.Status.State = &c.State
c.Status.State = c.State
}
func (c *fakeContainer) Stop() {
c.State = runtimeapi.ContainerState_CONTAINER_EXITED
c.Status.State = &c.State
exitSuccess := int32(0)
c.Status.ExitCode = &exitSuccess
c.Status.State = c.State
c.Status.ExitCode = 0
// c.Status.Reason
}
@ -191,7 +189,7 @@ func (r *FakeRuntime) ListContainers(*runtimeapi.ContainerFilter) ([]*runtimeapi
Metadata: c.Config.Metadata,
Labels: c.Config.Labels,
ImageRef: c.Status.ImageRef,
State: &c.State,
State: c.State,
})
}
@ -226,15 +224,15 @@ func (r *FakeRuntime) ExecSync(containerID string, cmd []string, timeout time.Du
}
func (r *FakeRuntime) Exec(req *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error) {
url := "http://" + FakeStreamingHost + ":" + FakeStreamingPort + "/exec/" + req.GetContainerId()
url := "http://" + FakeStreamingHost + ":" + FakeStreamingPort + "/exec/" + req.ContainerId
return &runtimeapi.ExecResponse{
Url: &url,
Url: url,
}, nil
}
func (r *FakeRuntime) Attach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error) {
url := "http://" + FakeStreamingHost + ":" + FakeStreamingPort + "/attach/" + req.GetContainerId()
url := "http://" + FakeStreamingHost + ":" + FakeStreamingPort + "/attach/" + req.ContainerId
return &runtimeapi.AttachResponse{
Url: &url,
Url: url,
}, nil
}

View File

@ -63,19 +63,19 @@ var (
var testImgSpecs = map[string]imageTestCase{
"non-existent-image": {
&runtimeapi.ImageSpec{
Image: &gibberishStr,
Image: gibberishStr,
},
nil,
},
"busybox": {
&runtimeapi.ImageSpec{
Image: &busyboxStr,
Image: busyboxStr,
},
&runtimeapi.Image{
Id: nil,
Id: "",
RepoTags: []string{},
RepoDigests: []string{},
Size_: nil,
Size_: 0,
},
},
}
@ -201,7 +201,7 @@ func TestListsImages(t *testing.T) {
}
for _, img := range imgs {
expectedImg := *testImgSpecs[*img.Id].ExpectedStatus
expectedImg := *testImgSpecs[img.Id].ExpectedStatus
if err := compareContainerImages(img, expectedImg); err != nil {
t.Errorf("rktshim.ImageStore.List() for %q, %v", img.Id, err)