mirror of https://github.com/k3s-io/k3s
kubelet/rktshim: update cri to protobuf v3
parent
76afc7300d
commit
e77e61b3bb
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue