Skip to content

Commit 5956e50

Browse files
committed
fix: unit test cases
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent 8a25c03 commit 5956e50

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

api/handlers/container/create.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -143,23 +143,6 @@ func (h *handler) create(w http.ResponseWriter, r *http.Request) {
143143
}
144144
}
145145

146-
// Annotations: TODO - available in nerdctl 2.0
147-
// Annotations are passed in as a map of strings,
148-
// but nerdctl expects an array of strings with format [annotations1=VALUE1, annotations2=VALUE2, ...].
149-
// annotations := []string{}
150-
// if req.HostConfig.Annotations != nil {
151-
// for key, val := range req.HostConfig.Annotations {
152-
// annotations = append(annotations, fmt.Sprintf("%s=%s", key, val))
153-
// }
154-
// }
155-
156-
ulimits := []string{}
157-
if req.HostConfig.Ulimits != nil {
158-
for _, ulimit := range req.HostConfig.Ulimits {
159-
ulimits = append(ulimits, ulimit.String())
160-
}
161-
}
162-
163146
// devices:
164147
// devices are passed in as a map of DeviceMapping,
165148
// but nerdctl expects an array of strings with format [PathOnHost1:PathInContainer1:CgroupPermissions1, PathOnHost2:PathInContainer2:CgroupPermissions2, ...].
@@ -250,11 +233,6 @@ func (h *handler) create(w http.ResponseWriter, r *http.Request) {
250233
securityOpt = req.HostConfig.SecurityOpt
251234
}
252235

253-
pidLimit := int64(-1)
254-
if req.HostConfig.PidsLimit > 0 {
255-
pidLimit = req.HostConfig.PidsLimit
256-
}
257-
258236
cgroupnsMode := defaults.CgroupnsMode()
259237
if req.HostConfig.CgroupnsMode.Valid() {
260238
cgroupnsMode = string(req.HostConfig.CgroupnsMode)
@@ -305,7 +283,6 @@ func (h *handler) create(w http.ResponseWriter, r *http.Request) {
305283
CPUSetMems: req.HostConfig.CPUSetMems, // CpusetMems 0-2, 0,1
306284
IPC: req.HostConfig.IpcMode, // IPC namespace to use
307285
ShmSize: shmSize, // ShmSize set the size of /dev/shm
308-
Ulimit: ulimits, // List of ulimits to be set in the container
309286
Device: devices, // Device specifies add a host device to the container
310287
// #endregion
311288

api/handlers/container/create_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,7 @@ func getDefaultCreateOpt(conf config.Config) types.ContainerCreateOptions {
11501150
CapAdd: []string{}, // nerdctl default.
11511151
CapDrop: []string{}, // nerdctl default.
11521152
Privileged: false,
1153+
GroupAdd: []string{}, // nerdctl default.
11531154
// #endregion
11541155

11551156
// #region for runtime flags

0 commit comments

Comments
 (0)