Skip to content

Commit 37bd4bf

Browse files
committed
id errors 6
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent 7f18572 commit 37bd4bf

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

cmd/nerdctl/container/container_inspect_linux_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package container
1818

1919
import (
20+
"encoding/json"
2021
"fmt"
2122
"strings"
2223
"testing"
@@ -62,12 +63,20 @@ func TestContainerInspectContainsMounts(t *testing.T) {
6263
"--name", testContainer,
6364
"--network", "none",
6465
"-v", "/anony-vol",
66+
"--tmpfs", "/app1:size=64m",
6567
"--mount", "type=bind,src=/tmp,dst=/app2,ro",
6668
"--mount", fmt.Sprintf("type=volume,src=%s,dst=/app3,readonly=false", testVolume),
6769
testutil.NginxAlpineImage).AssertOK()
6870

71+
t.Logf("before calling inspect in TestContainerInspectContainsMounts")
6972
inspect := base.InspectContainer(testContainer)
70-
t.Logf("inspect in TestContainerInspectContainsMounts: %+v", inspect)
73+
t.Logf("after calling inspect in TestContainerInspectContainsMounts")
74+
inspectJSON, err := json.MarshalIndent(inspect, "", " ")
75+
if err != nil {
76+
t.Errorf("Failed to marshal inspect: %v", err)
77+
} else {
78+
t.Logf("inspect in TestContainerInspectContainsMounts:\n%s", string(inspectJSON))
79+
}
7180
t.Logf("inspect.Mounts in TestContainerInspectContainsMounts: %+v", inspect.Mounts)
7281
// convert array to map to get by key of Destination
7382
actual := make(map[string]dockercompat.MountPoint)

pkg/inspecttypes/dockercompat/dockercompat.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,13 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
343343
return nil, err
344344
}
345345
c.Mounts = mounts
346-
if len(mounts) > 0 {
347-
tmpfsMounts = filterTmpfsMounts(mounts)
348-
}
346+
// if len(mounts) > 0 {
347+
// tmpfsMounts = filterTmpfsMounts(mounts)
348+
// }
349349
}
350+
// if len(tmpfsMounts) > 0 {
350351
c.HostConfig.Tmpfs = tmpfsMounts
352+
// }
351353

352354
if nedctlExtraHosts := n.Labels[labels.ExtraHosts]; nedctlExtraHosts != "" {
353355
c.HostConfig.ExtraHosts = parseExtraHosts(nedctlExtraHosts)

0 commit comments

Comments
 (0)