From 6fadb7f5e93175d1c218d17246df361b8f899ae1 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Thu, 18 Jan 2018 07:30:26 +0000 Subject: [PATCH] Minor code cleanup. Signed-off-by: Lantao Liu --- pkg/annotations/annotations.go | 2 ++ pkg/server/container_create_test.go | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/annotations/annotations.go b/pkg/annotations/annotations.go index eb3847bc7..f57b32af8 100644 --- a/pkg/annotations/annotations.go +++ b/pkg/annotations/annotations.go @@ -17,6 +17,8 @@ limitations under the License. package annotations // ContainerType values +// Following OCI annotations are used by katacontainers now. +// We'll switch to standard secure pod API after it is defined in CRI. const ( // ContainerTypeSandbox represents a pod sandbox container ContainerTypeSandbox = "sandbox" diff --git a/pkg/server/container_create_test.go b/pkg/server/container_create_test.go index 0415e36a4..52630aba2 100644 --- a/pkg/server/container_create_test.go +++ b/pkg/server/container_create_test.go @@ -185,7 +185,7 @@ func TestGeneralContainerSpec(t *testing.T) { testPid := uint32(1234) config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() c := newTestCRIContainerdService() - testSandboxID := "SandboxID" + testSandboxID := "sandbox-id" spec, err := c.generateContainerSpec(testID, testSandboxID, testPid, config, sandboxConfig, imageConfig, nil) require.NoError(t, err) specCheck(t, testID, testSandboxID, testPid, spec) @@ -193,7 +193,7 @@ func TestGeneralContainerSpec(t *testing.T) { func TestContainerCapabilities(t *testing.T) { testID := "test-id" - testSandboxID := "SandboxID" + testSandboxID := "sandbox-id" testPid := uint32(1234) config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() c := newTestCRIContainerdService() @@ -262,7 +262,7 @@ func TestContainerCapabilities(t *testing.T) { func TestContainerSpecTty(t *testing.T) { testID := "test-id" - testSandboxID := "SandboxID" + testSandboxID := "sandbox-id" testPid := uint32(1234) config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() c := newTestCRIContainerdService() @@ -282,7 +282,7 @@ func TestContainerSpecTty(t *testing.T) { func TestContainerSpecReadonlyRootfs(t *testing.T) { testID := "test-id" - testSandboxID := "SandboxID" + testSandboxID := "sandbox-id" testPid := uint32(1234) config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() c := newTestCRIContainerdService() @@ -297,7 +297,7 @@ func TestContainerSpecReadonlyRootfs(t *testing.T) { func TestContainerSpecWithExtraMounts(t *testing.T) { testID := "test-id" - testSandboxID := "SandboxID" + testSandboxID := "sandbox-id" testPid := uint32(1234) config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() c := newTestCRIContainerdService() @@ -701,7 +701,7 @@ func TestMountPropagation(t *testing.T) { func TestPidNamespace(t *testing.T) { testID := "test-id" testPid := uint32(1234) - testSandboxID := "SandboxID" + testSandboxID := "sandbox-id" config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() c := newTestCRIContainerdService() t.Logf("should not set pid namespace when host pid is true")