fixing typos

This commit is contained in:
Tuna 2016-08-10 10:09:27 +07:00
parent 8ddadfca88
commit 908a2563f1

View File

@ -855,7 +855,7 @@ func loadComposeFile(file string, opt convertOptions) KomposeObject {
// transform composeObject into komposeObject
composeServiceNames := composeObject.ServiceConfigs.Keys()
// volume config and network config has not supported
// volume config and network config are not supported
if len(composeObject.NetworkConfigs) > 0 {
logrus.Warningf("Unsupported network configuration of compose v2 - ignoring")
}
@ -863,15 +863,15 @@ func loadComposeFile(file string, opt convertOptions) KomposeObject {
logrus.Warningf("Unsupported volume configuration of compose v2 - ignoring")
}
count := 0
networksWarningFound := false
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 &&
strings.Compare(composeServiceConfig.Networks.Networks[0].Name, "default") != 0 &&
count == 0 {
composeServiceConfig.Networks.Networks[0].Name != "default" &&
!networksWarningFound {
logrus.Warningf("Unsupported key networks - ignoring")
count++
networksWarningFound = true
}
checkUnsupportedKey(composeServiceConfig)
serviceConfig := ServiceConfig{}
@ -1182,7 +1182,7 @@ func Convert(c *cli.Context) {
func checkUnsupportedKey(service interface{}) {
s := structs.New(service)
for _, f := range s.Fields() {
if f.IsExported() && !f.IsZero() && strings.Compare(f.Name(), "Networks") != 0 {
if f.IsExported() && !f.IsZero() && f.Name() != "Networks" {
if count, ok := unsupportedKey[f.Name()]; ok && count == 0 {
logrus.Warningf("Unsupported key %s - ignoring", composeOptions[f.Name()])
unsupportedKey[f.Name()]++