forked from LaconicNetwork/kompose
rebase master
This commit is contained in:
parent
baedd92036
commit
469b50c33d
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package kobject
|
package kobject
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/fatih/structs"
|
"github.com/fatih/structs"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ func CheckUnsupportedKey(service interface{}) {
|
|||||||
for _, f := range s.Fields() {
|
for _, f := range s.Fields() {
|
||||||
if f.IsExported() && !f.IsZero() && f.Name() != "Networks" {
|
if f.IsExported() && !f.IsZero() && f.Name() != "Networks" {
|
||||||
if count, ok := unsupportedKey[f.Name()]; ok && count == 0 {
|
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()]++
|
unsupportedKey[f.Name()]++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,7 +137,7 @@ func (c *Compose) LoadFile(file string) kobject.KomposeObject {
|
|||||||
for _, name := range composeServiceNames {
|
for _, name := range composeServiceNames {
|
||||||
if composeServiceConfig, ok := composeObject.ServiceConfigs.Get(name); ok {
|
if composeServiceConfig, ok := composeObject.ServiceConfigs.Get(name); ok {
|
||||||
//FIXME: networks always contains one default element, even it isn't declared in compose v2.
|
//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" &&
|
composeServiceConfig.Networks.Networks[0].Name != "default" &&
|
||||||
!networksWarningFound {
|
!networksWarningFound {
|
||||||
logrus.Warningf("Unsupported key networks - ignoring")
|
logrus.Warningf("Unsupported key networks - ignoring")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user