@@ -1017,6 +1017,59 @@ func TestLoadMultipleNetworks(t *testing.T) {
10171017 }, config )
10181018}
10191019
1020+ func TestLoadMultipleServiceCommands (t * testing.T ) {
1021+ base := map [string ]interface {}{
1022+ "version" : "3.7" ,
1023+ "services" : map [string ]interface {}{
1024+ "foo" : map [string ]interface {}{
1025+ "image" : "baz" ,
1026+ "command" : "foo bar" ,
1027+ },
1028+ },
1029+ "volumes" : map [string ]interface {}{},
1030+ "networks" : map [string ]interface {}{},
1031+ "secrets" : map [string ]interface {}{},
1032+ "configs" : map [string ]interface {}{},
1033+ }
1034+ override := map [string ]interface {}{
1035+ "version" : "3.7" ,
1036+ "services" : map [string ]interface {}{
1037+ "foo" : map [string ]interface {}{
1038+ "image" : "baz" ,
1039+ "command" : "foo baz" ,
1040+ },
1041+ },
1042+ "volumes" : map [string ]interface {}{},
1043+ "networks" : map [string ]interface {}{},
1044+ "secrets" : map [string ]interface {}{},
1045+ "configs" : map [string ]interface {}{},
1046+ }
1047+ configDetails := types.ConfigDetails {
1048+ ConfigFiles : []types.ConfigFile {
1049+ {Filename : "base.yml" , Config : base },
1050+ {Filename : "override.yml" , Config : override },
1051+ },
1052+ }
1053+ config , err := Load (configDetails )
1054+ assert .NilError (t , err )
1055+ assert .DeepEqual (t , & types.Config {
1056+ Filename : "base.yml" ,
1057+ Version : "3.7" ,
1058+ Services : []types.ServiceConfig {
1059+ {
1060+ Name : "foo" ,
1061+ Image : "baz" ,
1062+ Command : types.ShellCommand {"foo" , "baz" },
1063+ Environment : types.MappingWithEquals {},
1064+ },
1065+ },
1066+ Volumes : map [string ]types.VolumeConfig {},
1067+ Secrets : map [string ]types.SecretConfig {},
1068+ Configs : map [string ]types.ConfigObjConfig {},
1069+ Networks : map [string ]types.NetworkConfig {},
1070+ }, config )
1071+ }
1072+
10201073func TestLoadMultipleServiceVolumes (t * testing.T ) {
10211074 base := map [string ]interface {}{
10221075 "version" : "3.7" ,
0 commit comments