Browse code

daemon/cluster/executor/container: use consistent alias for import

The canonical alias is "containertypes" for this import.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2024/06/18 18:14:01
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ import (
11 11
 
12 12
 	"github.com/containerd/log"
13 13
 	"github.com/distribution/reference"
14
-	enginecontainer "github.com/docker/docker/api/types/container"
14
+	containertypes "github.com/docker/docker/api/types/container"
15 15
 	"github.com/docker/docker/api/types/events"
16 16
 	"github.com/docker/docker/api/types/filters"
17 17
 	enginemount "github.com/docker/docker/api/types/mount"
... ...
@@ -160,7 +160,7 @@ func (c *containerConfig) portBindings() nat.PortMap {
160 160
 	return portBindings
161 161
 }
162 162
 
163
-func (c *containerConfig) isolation() enginecontainer.Isolation {
163
+func (c *containerConfig) isolation() containertypes.Isolation {
164 164
 	return convert.IsolationFromGRPC(c.spec().Isolation)
165 165
 }
166 166
 
... ...
@@ -190,11 +190,11 @@ func (c *containerConfig) exposedPorts() map[nat.Port]struct{} {
190 190
 	return exposedPorts
191 191
 }
192 192
 
193
-func (c *containerConfig) config() *enginecontainer.Config {
193
+func (c *containerConfig) config() *containertypes.Config {
194 194
 	genericEnvs := genericresource.EnvFormat(c.task.AssignedGenericResources, "DOCKER_RESOURCE")
195 195
 	env := append(c.spec().Env, genericEnvs...)
196 196
 
197
-	config := &enginecontainer.Config{
197
+	config := &containertypes.Config{
198 198
 		Labels:       c.labels(),
199 199
 		StopSignal:   c.spec().StopSignal,
200 200
 		Tty:          c.spec().TTY,
... ...
@@ -375,7 +375,7 @@ func convertMount(m api.Mount) enginemount.Mount {
375 375
 	return mount
376 376
 }
377 377
 
378
-func (c *containerConfig) healthcheck() *enginecontainer.HealthConfig {
378
+func (c *containerConfig) healthcheck() *containertypes.HealthConfig {
379 379
 	hcSpec := c.spec().Healthcheck
380 380
 	if hcSpec == nil {
381 381
 		return nil
... ...
@@ -384,7 +384,7 @@ func (c *containerConfig) healthcheck() *enginecontainer.HealthConfig {
384 384
 	timeout, _ := gogotypes.DurationFromProto(hcSpec.Timeout)
385 385
 	startPeriod, _ := gogotypes.DurationFromProto(hcSpec.StartPeriod)
386 386
 	startInterval, _ := gogotypes.DurationFromProto(hcSpec.StartInterval)
387
-	return &enginecontainer.HealthConfig{
387
+	return &containertypes.HealthConfig{
388 388
 		Test:          hcSpec.Test,
389 389
 		Interval:      interval,
390 390
 		Timeout:       timeout,
... ...
@@ -394,8 +394,8 @@ func (c *containerConfig) healthcheck() *enginecontainer.HealthConfig {
394 394
 	}
395 395
 }
396 396
 
397
-func (c *containerConfig) hostConfig(deps exec.VolumeGetter) *enginecontainer.HostConfig {
398
-	hc := &enginecontainer.HostConfig{
397
+func (c *containerConfig) hostConfig(deps exec.VolumeGetter) *containertypes.HostConfig {
398
+	hc := &containertypes.HostConfig{
399 399
 		Resources:      c.resources(),
400 400
 		GroupAdd:       c.spec().Groups,
401 401
 		PortBindings:   c.portBindings(),
... ...
@@ -432,7 +432,7 @@ func (c *containerConfig) hostConfig(deps exec.VolumeGetter) *enginecontainer.Ho
432 432
 	}
433 433
 
434 434
 	if c.task.LogDriver != nil {
435
-		hc.LogConfig = enginecontainer.LogConfig{
435
+		hc.LogConfig = containertypes.LogConfig{
436 436
 			Type:   c.task.LogDriver.Name,
437 437
 			Config: c.task.LogDriver.Options,
438 438
 		}
... ...
@@ -442,7 +442,7 @@ func (c *containerConfig) hostConfig(deps exec.VolumeGetter) *enginecontainer.Ho
442 442
 		labels := c.task.Networks[0].Network.Spec.Annotations.Labels
443 443
 		name := c.task.Networks[0].Network.Spec.Annotations.Name
444 444
 		if v, ok := labels["com.docker.swarm.predefined"]; ok && v == "true" {
445
-			hc.NetworkMode = enginecontainer.NetworkMode(name)
445
+			hc.NetworkMode = containertypes.NetworkMode(name)
446 446
 		}
447 447
 	}
448 448
 
... ...
@@ -474,8 +474,8 @@ func (c *containerConfig) volumeCreateRequest(mount *api.Mount) *volume.CreateOp
474 474
 	return nil
475 475
 }
476 476
 
477
-func (c *containerConfig) resources() enginecontainer.Resources {
478
-	resources := enginecontainer.Resources{}
477
+func (c *containerConfig) resources() containertypes.Resources {
478
+	resources := containertypes.Resources{}
479 479
 
480 480
 	// set pids limit
481 481
 	pidsLimit := c.spec().PidsLimit
... ...
@@ -672,7 +672,7 @@ func (c *containerConfig) networkCreateRequest(name string) (clustertypes.Networ
672 672
 	}, nil
673 673
 }
674 674
 
675
-func (c *containerConfig) applyPrivileges(hc *enginecontainer.HostConfig) {
675
+func (c *containerConfig) applyPrivileges(hc *containertypes.HostConfig) {
676 676
 	privileges := c.spec().Privileges
677 677
 	if privileges == nil {
678 678
 		return