Skip to content

Commit

Permalink
Update checking to see if a default network has been provided
Browse files Browse the repository at this point in the history
Due to changes to libcompose, NetworkConfigs now returns a default
network regardless if one has been provided or not.

An if statement is added that will debug output and ignore the default
network provided that it's the only network available.
  • Loading branch information
cdrage committed Jan 10, 2017
1 parent 5703942 commit 39fbc4a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/loader/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ func checkUnsupportedKey(composeProject *project.Project) []string {
// collect all keys found in project
var keysFound []string

// Root level keys
// volume config and network config are not supported
if len(composeProject.NetworkConfigs) > 0 {
// Root level keys are not yet supported
// Check to see if the default network is available and length is only equal to one.
// Else, warn the user that root level networks are not supported (yet)
if _, ok := composeProject.NetworkConfigs["default"]; ok && len(composeProject.NetworkConfigs) == 1 {
logrus.Debug("Default network found")
} else if len(composeProject.NetworkConfigs) > 0 {
keysFound = append(keysFound, "root level networks")
}

// Root level volumes are not yet supported
if len(composeProject.VolumeConfigs) > 0 {
keysFound = append(keysFound, "root level volumes")
}
Expand Down

0 comments on commit 39fbc4a

Please sign in to comment.