Skip to content

Commit 103375e

Browse files
elezartariq1890
authored andcommitted
Convert containerd to runtime package
Signed-off-by: Evan Lezar <[email protected]>
1 parent 5bedbc2 commit 103375e

File tree

9 files changed

+292
-308
lines changed

9 files changed

+292
-308
lines changed

tools/container/containerd/containerd.go

Lines changed: 0 additions & 260 deletions
This file was deleted.

tools/container/containerd/config_v1_test.go renamed to tools/container/runtime/containerd/config_v1_test.go

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
*/
1616

17-
package main
17+
package containerd
1818

1919
import (
2020
"fmt"
@@ -82,14 +82,10 @@ func TestUpdateV1ConfigDefaultRuntime(t *testing.T) {
8282

8383
for i, tc := range testCases {
8484
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
85-
o := &options{
86-
Options: container.Options{
87-
RuntimeName: tc.runtimeName,
88-
RuntimeDir: runtimeDir,
89-
SetAsDefault: tc.setAsDefault,
90-
},
91-
runtimeType: runtimeType,
92-
useLegacyConfig: tc.legacyConfig,
85+
o := &container.Options{
86+
RuntimeName: tc.runtimeName,
87+
RuntimeDir: runtimeDir,
88+
SetAsDefault: tc.setAsDefault,
9389
}
9490

9591
cfg, err := toml.Empty.Load()
@@ -233,11 +229,9 @@ func TestUpdateV1Config(t *testing.T) {
233229

234230
for i, tc := range testCases {
235231
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
236-
o := &options{
237-
Options: container.Options{
238-
RuntimeName: tc.runtimeName,
239-
RuntimeDir: runtimeDir,
240-
},
232+
o := &container.Options{
233+
RuntimeName: tc.runtimeName,
234+
RuntimeDir: runtimeDir,
241235
}
242236

243237
cfg, err := toml.Empty.Load()
@@ -394,11 +388,9 @@ func TestUpdateV1ConfigWithRuncPresent(t *testing.T) {
394388

395389
for i, tc := range testCases {
396390
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
397-
o := &options{
398-
Options: container.Options{
399-
RuntimeName: tc.runtimeName,
400-
RuntimeDir: runtimeDir,
401-
},
391+
o := &container.Options{
392+
RuntimeName: tc.runtimeName,
393+
RuntimeDir: runtimeDir,
402394
}
403395

404396
cfg, err := toml.TreeFromMap(runcConfigMapV1("/runc-binary"))
@@ -473,10 +465,8 @@ func TestRevertV1Config(t *testing.T) {
473465

474466
for i, tc := range testCases {
475467
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
476-
o := &options{
477-
Options: container.Options{
478-
RuntimeName: "nvidia",
479-
},
468+
o := &container.Options{
469+
RuntimeName: "nvidia",
480470
}
481471

482472
cfg, err := toml.LoadMap(tc.config)

0 commit comments

Comments
 (0)