Skip to content

Commit

Permalink
Don't create Host key in Volume if no hostPath is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanevet authored and tiffanyfay committed Jan 31, 2017
1 parent 51076cf commit 8aef474
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions ecs-cli/modules/compose/ecs/utils/convert_task_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,20 @@ func createKeyValuePair(key, value string) *ecs.KeyValuePair {
func convertToECSVolumes(hostPaths map[string]string) []*ecs.Volume {
output := []*ecs.Volume{}
for hostPath, volName := range hostPaths {
ecsVolume := &ecs.Volume{
Name: aws.String(volName),
Host: &ecs.HostVolumeProperties{
SourcePath: aws.String(hostPath),
},
if hostPath == "" {
ecsVolume := &ecs.Volume{
Name: aws.String(volName),
}
output = append(output, ecsVolume)
} else {
ecsVolume := &ecs.Volume{
Name: aws.String(volName),
Host: &ecs.HostVolumeProperties{
SourcePath: aws.String(hostPath),
},
}
output = append(output, ecsVolume)
}
output = append(output, ecsVolume)
}
return output
}
Expand Down

0 comments on commit 8aef474

Please sign in to comment.