Skip to content

Commit d02f35f

Browse files
Updates.
1 parent c872343 commit d02f35f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

containerd/containerd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (d *Driver) pullImage(imageName string) (containerd.Image, error) {
4141
return d.client.Pull(d.ctxContainerd, imageName, containerd.WithPullUnpack)
4242
}
4343

44-
func (d *Driver) createContainer(image containerd.Image, containerName, containerSnapshotName, containerdRuntime, networkNamespacePath string, env []string, config *TaskConfig) (containerd.Container, error) {
44+
func (d *Driver) createContainer(image containerd.Image, containerName, containerSnapshotName, containerdRuntime, netnsPath string, env []string, config *TaskConfig) (containerd.Container, error) {
4545
if config.Command == "" && len(config.Args) > 0 {
4646
return nil, fmt.Errorf("Command is empty. Cannot set --args without --command.")
4747
}
@@ -123,8 +123,8 @@ func (d *Driver) createContainer(image containerd.Image, containerName, containe
123123
opts = append(opts, oci.WithMounts(mounts))
124124
}
125125

126-
if networkNamespacePath != "" {
127-
opts = append(opts, oci.WithLinuxNamespace(specs.LinuxNamespace{Type: specs.NetworkNamespace, Path: networkNamespacePath}))
126+
if netnsPath != "" {
127+
opts = append(opts, oci.WithLinuxNamespace(specs.LinuxNamespace{Type: specs.NetworkNamespace, Path: netnsPath}))
128128
}
129129

130130
return d.client.NewContainer(

containerd/driver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,12 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drive
360360
}
361361

362362
containerSnapshotName := fmt.Sprintf("%s-snapshot", containerName)
363-
var networkNamespacePath string
363+
var netnsPath string
364364
if cfg.NetworkIsolation != nil && cfg.NetworkIsolation.Path != "" {
365-
networkNamespacePath = cfg.NetworkIsolation.Path
365+
netnsPath = cfg.NetworkIsolation.Path
366366
}
367367

368-
container, err := d.createContainer(image, containerName, containerSnapshotName, d.config.ContainerdRuntime, networkNamespacePath, env, &driverConfig)
368+
container, err := d.createContainer(image, containerName, containerSnapshotName, d.config.ContainerdRuntime, netnsPath, env, &driverConfig)
369369
if err != nil {
370370
return nil, nil, fmt.Errorf("Error in creating container: %v", err)
371371
}

0 commit comments

Comments
 (0)