rebase master

This commit is contained in:
Tuna 2016-08-12 10:38:33 +07:00
parent baedd92036
commit 469b50c33d
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ limitations under the License.
package kobject
import (
"fmt"
"github.com/Sirupsen/logrus"
"github.com/fatih/structs"
)
@ -180,7 +180,7 @@ func CheckUnsupportedKey(service interface{}) {
for _, f := range s.Fields() {
if f.IsExported() && !f.IsZero() && f.Name() != "Networks" {
if count, ok := unsupportedKey[f.Name()]; ok && count == 0 {
fmt.Println("WARNING: Unsupported key " + composeOptions[f.Name()] + " - ignoring")
logrus.Warningf("Unsupported key %s - ignoring", composeOptions[f.Name()])
unsupportedKey[f.Name()]++
}
}

View File

@ -137,7 +137,7 @@ func (c *Compose) LoadFile(file string) kobject.KomposeObject {
for _, name := range composeServiceNames {
if composeServiceConfig, ok := composeObject.ServiceConfigs.Get(name); ok {
//FIXME: networks always contains one default element, even it isn't declared in compose v2.
if len(composeServiceConfig.Networks.Networks) > 0 &&
if composeServiceConfig.Networks != nil && len(composeServiceConfig.Networks.Networks) > 0 &&
composeServiceConfig.Networks.Networks[0].Name != "default" &&
!networksWarningFound {
logrus.Warningf("Unsupported key networks - ignoring")