diff --git a/pkg/kubelet/rktshim/fake-app-interface.go b/pkg/kubelet/rktshim/fake-app-interface.go index 231317dd141..6fa86f38d47 100644 --- a/pkg/kubelet/rktshim/fake-app-interface.go +++ b/pkg/kubelet/rktshim/fake-app-interface.go @@ -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 } diff --git a/pkg/kubelet/rktshim/imagestore_test.go b/pkg/kubelet/rktshim/imagestore_test.go index 22c9c5a5054..4783965b29e 100644 --- a/pkg/kubelet/rktshim/imagestore_test.go +++ b/pkg/kubelet/rktshim/imagestore_test.go @@ -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)