Skip to content

Commit

Permalink
Upgraded network creation to support an array
Browse files Browse the repository at this point in the history
  • Loading branch information
just1689 committed Apr 30, 2019
1 parent dffe00b commit 235470d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions controller/pc-docker/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ func CreateService(service *model.Service) (err error) {

replicas := uint64(service.Replicas)

networkName := service.Network
if networkName != "" {
err = createNetwork(networkName)
} else {
networkName = DefaultNetwork
err = createNetwork(networkName)
}
if err != nil {
log.Printf("Error occurred while creating the network %s: %s", networkName, err)
for _, networkName := range service.Networks {
if networkName != "" {
err = createNetwork(networkName)
} else {
networkName = DefaultNetwork
err = createNetwork(networkName)
}
if err != nil {
log.Printf("Error occurred while creating the network %s: %s", networkName, err)
}
}

var nets []swarm.NetworkAttachmentConfig
Expand Down

0 comments on commit 235470d

Please sign in to comment.