@@ -21,7 +21,7 @@ import (
21
21
"strconv"
22
22
"testing"
23
23
24
- containers "github.com/aws/amazon-ecs-cli/ecs-cli/modules/cli/compose/containerconfig "
24
+ "github.com/aws/amazon-ecs-cli/ecs-cli/modules/cli/compose/adapter "
25
25
"github.com/aws/aws-sdk-go/aws"
26
26
"github.com/aws/aws-sdk-go/service/ecs"
27
27
"github.com/docker/libcompose/config"
@@ -45,7 +45,7 @@ var defaultNetwork = &yaml.Network{
45
45
}
46
46
47
47
// TODO Extract test docker file and use in test (to avoid gaps between parse and conversion unit tests)
48
- var testContainerConfig = & containers .ContainerConfig {
48
+ var testContainerConfig = & adapter .ContainerConfig {
49
49
Name : "mysql" ,
50
50
Command : []string {"cmd" },
51
51
CPU : int64 (131072 ),
@@ -252,7 +252,7 @@ func TestConvertToTaskDefinition(t *testing.T) {
252
252
253
253
// ConvertToContainerDefinition tests
254
254
func TestConvertToTaskDefinitionWithNoSharedMemorySize (t * testing.T ) {
255
- containerConfig := & containers .ContainerConfig {
255
+ containerConfig := & adapter .ContainerConfig {
256
256
ShmSize : int64 (0 ),
257
257
}
258
258
@@ -263,7 +263,7 @@ func TestConvertToTaskDefinitionWithNoSharedMemorySize(t *testing.T) {
263
263
}
264
264
265
265
func TestConvertToTaskDefinitionWithNoTmpfs (t * testing.T ) {
266
- containerConfig := & containers .ContainerConfig {
266
+ containerConfig := & adapter .ContainerConfig {
267
267
Tmpfs : nil ,
268
268
}
269
269
@@ -277,7 +277,7 @@ func TestConvertToTaskDefinitionWithNoTmpfs(t *testing.T) {
277
277
278
278
// Test Launch Types
279
279
func TestConvertToTaskDefinitionLaunchTypeEmpty (t * testing.T ) {
280
- containerConfig := & containers .ContainerConfig {}
280
+ containerConfig := & adapter .ContainerConfig {}
281
281
282
282
taskDefinition := convertToTaskDefinitionInTest (t , nil , containerConfig , "" , "" )
283
283
if len (taskDefinition .RequiresCompatibilities ) > 0 {
@@ -286,7 +286,7 @@ func TestConvertToTaskDefinitionLaunchTypeEmpty(t *testing.T) {
286
286
}
287
287
288
288
func TestConvertToTaskDefinitionLaunchTypeEC2 (t * testing.T ) {
289
- containerConfig := & containers .ContainerConfig {}
289
+ containerConfig := & adapter .ContainerConfig {}
290
290
291
291
taskDefinition := convertToTaskDefinitionInTest (t , nil , containerConfig , "" , "EC2" )
292
292
if len (taskDefinition .RequiresCompatibilities ) != 1 {
@@ -296,7 +296,7 @@ func TestConvertToTaskDefinitionLaunchTypeEC2(t *testing.T) {
296
296
}
297
297
298
298
func TestConvertToTaskDefinitionLaunchTypeFargate (t * testing.T ) {
299
- containerConfig := & containers .ContainerConfig {}
299
+ containerConfig := & adapter .ContainerConfig {}
300
300
301
301
taskDefinition := convertToTaskDefinitionInTest (t , nil , containerConfig , "" , "FARGATE" )
302
302
if len (taskDefinition .RequiresCompatibilities ) != 1 {
@@ -306,10 +306,10 @@ func TestConvertToTaskDefinitionLaunchTypeFargate(t *testing.T) {
306
306
}
307
307
308
308
// Test Conversion with ECS Params
309
- func testContainerConfigs (names []string ) []containers .ContainerConfig {
310
- containerConfigs := []containers .ContainerConfig {}
309
+ func testContainerConfigs (names []string ) []adapter .ContainerConfig {
310
+ containerConfigs := []adapter .ContainerConfig {}
311
311
for _ , name := range names {
312
- config := containers .ContainerConfig {Name : name }
312
+ config := adapter .ContainerConfig {Name : name }
313
313
containerConfigs = append (containerConfigs , config )
314
314
}
315
315
@@ -775,7 +775,7 @@ func TestMemReservationHigherThanMemLimit(t *testing.T) {
775
775
user := "user"
776
776
workingDir := "/var"
777
777
778
- containerConfig := containers .ContainerConfig {
778
+ containerConfig := adapter .ContainerConfig {
779
779
CPU : cpu ,
780
780
Command : []string {command },
781
781
Hostname : hostname ,
@@ -790,7 +790,7 @@ func TestMemReservationHigherThanMemLimit(t *testing.T) {
790
790
791
791
volumeConfigs := make (map [string ]* config.VolumeConfig )
792
792
793
- containerConfigs := []containers .ContainerConfig {containerConfig }
793
+ containerConfigs := []adapter .ContainerConfig {containerConfig }
794
794
795
795
envLookup , err := GetDefaultEnvironmentLookup ()
796
796
assert .NoError (t , err , "Unexpected error setting up environment lookup" )
@@ -1209,11 +1209,11 @@ func TestConvertToVolumes_ErrorsWithExternalSubfield(t *testing.T) {
1209
1209
assert .Error (t , err , "Expected error converting libcompose volume configs when external is specified" )
1210
1210
}
1211
1211
1212
- func convertToTaskDefinitionInTest (t * testing.T , volumeConfig * config.VolumeConfig , containerConfig * containers .ContainerConfig , taskRoleArn string , launchType string ) * ecs.TaskDefinition {
1212
+ func convertToTaskDefinitionInTest (t * testing.T , volumeConfig * config.VolumeConfig , containerConfig * adapter .ContainerConfig , taskRoleArn string , launchType string ) * ecs.TaskDefinition {
1213
1213
volumeConfigs := make (map [string ]* config.VolumeConfig )
1214
1214
volumeConfigs [namedVolume ] = volumeConfig
1215
1215
1216
- containerConfigs := []containers .ContainerConfig {}
1216
+ containerConfigs := []adapter .ContainerConfig {}
1217
1217
containerConfigs = append (containerConfigs , * containerConfig )
1218
1218
1219
1219
envLookup , err := GetDefaultEnvironmentLookup ()
@@ -1237,7 +1237,7 @@ func convertToTaskDefinitionInTest(t *testing.T, volumeConfig *config.VolumeConf
1237
1237
return taskDefinition
1238
1238
}
1239
1239
1240
- func convertToTaskDefWithEcsParamsInTest (t * testing.T , volumeConfig * config.VolumeConfig , containerConfigs []containers .ContainerConfig , taskRoleArn string , ecsParams * ECSParams ) (* ecs.TaskDefinition , error ) {
1240
+ func convertToTaskDefWithEcsParamsInTest (t * testing.T , volumeConfig * config.VolumeConfig , containerConfigs []adapter .ContainerConfig , taskRoleArn string , ecsParams * ECSParams ) (* ecs.TaskDefinition , error ) {
1241
1241
volumeConfigs := make (map [string ]* config.VolumeConfig )
1242
1242
if volumeConfig != nil {
1243
1243
volumeConfigs [namedVolume ] = volumeConfig
@@ -1273,7 +1273,7 @@ func findContainerByName(name string, containerDefs []*ecs.ContainerDefinition)
1273
1273
}
1274
1274
1275
1275
func TestIsZeroForEmptyConfig (t * testing.T ) {
1276
- containerConfig := & containers .ContainerConfig {}
1276
+ containerConfig := & adapter .ContainerConfig {}
1277
1277
1278
1278
configValue := reflect .ValueOf (containerConfig ).Elem ()
1279
1279
configType := configValue .Type ()
@@ -1303,7 +1303,7 @@ func TestIsZeroWhenConfigHasValues(t *testing.T) {
1303
1303
"WorkingDirectory" : true ,
1304
1304
}
1305
1305
1306
- containerConfig := & containers .ContainerConfig {
1306
+ containerConfig := & adapter .ContainerConfig {
1307
1307
CPU : int64 (10 ),
1308
1308
Command : []string {"cmd" },
1309
1309
Hostname : "foobarbaz" ,
0 commit comments