@@ -74,6 +74,12 @@ func TestParseV1V2_Version1_HappyPath(t *testing.T) {
74
74
securityOpts := []string {"label:type:test_virt" }
75
75
shmSize := int64 (128 )
76
76
user := "user"
77
+ volumesFrom := []* ecs.VolumeFrom {
78
+ {
79
+ ReadOnly : aws .Bool (true ),
80
+ SourceContainer : aws .String ("web" ),
81
+ },
82
+ }
77
83
workingDir := "/var"
78
84
79
85
composeV1FileString := `web:
@@ -115,7 +121,9 @@ func TestParseV1V2_Version1_HappyPath(t *testing.T) {
115
121
- ./code
116
122
working_dir: /var
117
123
redis:
118
- image: redis`
124
+ image: redis
125
+ volumes_from:
126
+ - web:ro`
119
127
120
128
// Setup docker-compose file
121
129
tmpfile , err := ioutil .TempFile ("" , "test" )
@@ -142,6 +150,7 @@ redis:
142
150
assert .NoError (t , err , "Unexpected error retrieving redis config" )
143
151
144
152
assert .Equal (t , redisImage , redis .Image , "Expected image to match" )
153
+ assert .Equal (t , volumesFrom , redis .VolumesFrom , "Expected VolumesFrom to match" )
145
154
146
155
// verify web ContainerConfig
147
156
web , err := getContainerConfigByName ("web" , actualConfigs )
@@ -223,6 +232,12 @@ func TestParseV1V2_Version2Files(t *testing.T) {
223
232
Size : aws .Int64 (64 ),
224
233
},
225
234
}
235
+ volumesFrom := []* ecs.VolumeFrom {
236
+ {
237
+ ReadOnly : aws .Bool (false ),
238
+ SourceContainer : aws .String ("mysql" ),
239
+ },
240
+ }
226
241
227
242
composeV2FileString := `version: '2'
228
243
services:
@@ -244,6 +259,8 @@ services:
244
259
driver: syslog
245
260
options:
246
261
syslog-address: "tcp://192.168.0.42:123"
262
+ volumes_from:
263
+ - mysql:rw
247
264
mysql:
248
265
image: mysql
249
266
volumes:
@@ -287,6 +304,7 @@ volumes:
287
304
assert .Equal (t , ports , wordpress .PortMappings , "Expected ports to match" )
288
305
assert .Equal (t , shmSize , wordpress .ShmSize , "Expected shmSize to match" )
289
306
assert .ElementsMatch (t , tmpfs , wordpress .Tmpfs , "Expected tmpfs to match" )
307
+ assert .Equal (t , volumesFrom , wordpress .VolumesFrom , "Expected VolumesFrom to match" )
290
308
291
309
// verify mysql ContainerConfig
292
310
mysql , err := getContainerConfigByName ("mysql" , actualConfigs )
0 commit comments