Skip to content

Commit 7647f5d

Browse files
committed
Fix json style of ipc
Signed-off-by: Min Uk Lee <[email protected]> - Fix json style of ipc labels - Fix case sensitive comparison test
1 parent 0f2b0d1 commit 7647f5d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cmd/nerdctl/container_run_linux_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ func TestRunIPCContainerNotExists(t *testing.T) {
9999
result := base.Cmd("run", "--name", container, "--ipc", "container:abcd1234", testutil.AlpineImage, "sleep", "infinity").Run()
100100
defer base.Cmd("rm", "-f", container)
101101
combined := result.Combined()
102-
if !strings.Contains(combined, "no such container: abcd1234") &&
103-
!strings.Contains(combined, "No such container: abcd1234") {
102+
if !strings.Contains(strings.ToLower(combined), "no such container: abcd1234") {
104103
t.Fatalf("unexpected output: %s", combined)
105104
}
106105
}

pkg/ipcutil/ipcutil.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ type IPCMode string
4040
type IPC struct {
4141
Mode IPCMode `json:"mode,omitempty"`
4242
// VictimContainer is only used when mode is container
43-
VictimContainerID *string `json:"victim_container_id,omitempty"`
43+
VictimContainerID *string `json:"victimContainerId,omitempty"`
4444

4545
// HostShmPath is only used when mode is shareable
46-
HostShmPath *string `json:"host_shm_path,omitempty"`
46+
HostShmPath *string `json:"hostShmPath,omitempty"`
4747

4848
// ShmSize is only used when mode is private or shareable
4949
// Devshm size in bytes
50-
ShmSize string `json:"shm_size,omitempty"`
50+
ShmSize string `json:"shmSize,omitempty"`
5151
}
5252

5353
const (

0 commit comments

Comments
 (0)