Minor code cleanup.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu 2018-01-18 07:30:26 +00:00
parent ca3b73899a
commit 6fadb7f5e9
2 changed files with 8 additions and 6 deletions

View File

@ -17,6 +17,8 @@ limitations under the License.
package annotations package annotations
// ContainerType values // 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 ( const (
// ContainerTypeSandbox represents a pod sandbox container // ContainerTypeSandbox represents a pod sandbox container
ContainerTypeSandbox = "sandbox" ContainerTypeSandbox = "sandbox"

View File

@ -185,7 +185,7 @@ func TestGeneralContainerSpec(t *testing.T) {
testPid := uint32(1234) testPid := uint32(1234)
config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData()
c := newTestCRIContainerdService() c := newTestCRIContainerdService()
testSandboxID := "SandboxID" testSandboxID := "sandbox-id"
spec, err := c.generateContainerSpec(testID, testSandboxID, testPid, config, sandboxConfig, imageConfig, nil) spec, err := c.generateContainerSpec(testID, testSandboxID, testPid, config, sandboxConfig, imageConfig, nil)
require.NoError(t, err) require.NoError(t, err)
specCheck(t, testID, testSandboxID, testPid, spec) specCheck(t, testID, testSandboxID, testPid, spec)
@ -193,7 +193,7 @@ func TestGeneralContainerSpec(t *testing.T) {
func TestContainerCapabilities(t *testing.T) { func TestContainerCapabilities(t *testing.T) {
testID := "test-id" testID := "test-id"
testSandboxID := "SandboxID" testSandboxID := "sandbox-id"
testPid := uint32(1234) testPid := uint32(1234)
config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData()
c := newTestCRIContainerdService() c := newTestCRIContainerdService()
@ -262,7 +262,7 @@ func TestContainerCapabilities(t *testing.T) {
func TestContainerSpecTty(t *testing.T) { func TestContainerSpecTty(t *testing.T) {
testID := "test-id" testID := "test-id"
testSandboxID := "SandboxID" testSandboxID := "sandbox-id"
testPid := uint32(1234) testPid := uint32(1234)
config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData()
c := newTestCRIContainerdService() c := newTestCRIContainerdService()
@ -282,7 +282,7 @@ func TestContainerSpecTty(t *testing.T) {
func TestContainerSpecReadonlyRootfs(t *testing.T) { func TestContainerSpecReadonlyRootfs(t *testing.T) {
testID := "test-id" testID := "test-id"
testSandboxID := "SandboxID" testSandboxID := "sandbox-id"
testPid := uint32(1234) testPid := uint32(1234)
config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData()
c := newTestCRIContainerdService() c := newTestCRIContainerdService()
@ -297,7 +297,7 @@ func TestContainerSpecReadonlyRootfs(t *testing.T) {
func TestContainerSpecWithExtraMounts(t *testing.T) { func TestContainerSpecWithExtraMounts(t *testing.T) {
testID := "test-id" testID := "test-id"
testSandboxID := "SandboxID" testSandboxID := "sandbox-id"
testPid := uint32(1234) testPid := uint32(1234)
config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData()
c := newTestCRIContainerdService() c := newTestCRIContainerdService()
@ -701,7 +701,7 @@ func TestMountPropagation(t *testing.T) {
func TestPidNamespace(t *testing.T) { func TestPidNamespace(t *testing.T) {
testID := "test-id" testID := "test-id"
testPid := uint32(1234) testPid := uint32(1234)
testSandboxID := "SandboxID" testSandboxID := "sandbox-id"
config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() config, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData()
c := newTestCRIContainerdService() c := newTestCRIContainerdService()
t.Logf("should not set pid namespace when host pid is true") t.Logf("should not set pid namespace when host pid is true")