forked from LaconicNetwork/kompose
printing warning of unsupported keys
This commit is contained in:
parent
14bc3697c8
commit
278a8af04f
@ -61,33 +61,42 @@ var unsupportedKey = map[string]string{
|
|||||||
"CapDrop": "",
|
"CapDrop": "",
|
||||||
"CPUSet": "",
|
"CPUSet": "",
|
||||||
"CPUShares": "",
|
"CPUShares": "",
|
||||||
"ContainerName": "",
|
"CPUQuota": "",
|
||||||
|
"CgroupParent": "",
|
||||||
"Devices": "",
|
"Devices": "",
|
||||||
|
"DependsOn": "",
|
||||||
"DNS": "",
|
"DNS": "",
|
||||||
"DNSSearch": "",
|
"DNSSearch": "",
|
||||||
"Dockerfile": "",
|
|
||||||
"DomainName": "",
|
"DomainName": "",
|
||||||
"Entrypoint": "",
|
"Entrypoint": "",
|
||||||
"EnvFile": "",
|
"EnvFile": "",
|
||||||
|
"Expose": "",
|
||||||
|
"Extends": "",
|
||||||
|
"ExternalLinks": "",
|
||||||
|
"ExtraHosts": "",
|
||||||
"Hostname": "",
|
"Hostname": "",
|
||||||
"LogDriver": "",
|
"Ipc": "",
|
||||||
|
"Logging": "",
|
||||||
|
"MacAddress": "",
|
||||||
"MemLimit": "",
|
"MemLimit": "",
|
||||||
"MemSwapLimit": "",
|
"MemSwapLimit": "",
|
||||||
"Net": "",
|
"NetworkMode": "",
|
||||||
|
"Networks": "",
|
||||||
"Pid": "",
|
"Pid": "",
|
||||||
"Uts": "",
|
|
||||||
"Ipc": "",
|
|
||||||
"ReadOnly": "",
|
|
||||||
"StdinOpen": "",
|
|
||||||
"SecurityOpt": "",
|
"SecurityOpt": "",
|
||||||
"Tty": "",
|
"ShmSize": "",
|
||||||
"User": "",
|
"StopSignal": "",
|
||||||
"VolumeDriver": "",
|
"VolumeDriver": "",
|
||||||
"VolumesFrom": "",
|
"VolumesFrom": "",
|
||||||
"Expose": "",
|
"Uts": "",
|
||||||
"ExternalLinks": "",
|
"ReadOnly": "",
|
||||||
"LogOpt": "",
|
"StdinOpen": "",
|
||||||
"ExtraHosts": "",
|
"Tty": "",
|
||||||
|
"User": "",
|
||||||
|
"Ulimits": "",
|
||||||
|
"Dockerfile": "",
|
||||||
|
"Net": "",
|
||||||
|
"Args": "",
|
||||||
}
|
}
|
||||||
|
|
||||||
// RandStringBytes generates randomly n-character string
|
// RandStringBytes generates randomly n-character string
|
||||||
@ -688,6 +697,8 @@ func loadBundlesFile(file string) KomposeObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for name, service := range bundle.Services {
|
for name, service := range bundle.Services {
|
||||||
|
checkUnsupportedKey(service)
|
||||||
|
|
||||||
serviceConfig := ServiceConfig{}
|
serviceConfig := ServiceConfig{}
|
||||||
serviceConfig.Command = service.Command
|
serviceConfig.Command = service.Command
|
||||||
serviceConfig.Args = service.Args
|
serviceConfig.Args = service.Args
|
||||||
@ -743,6 +754,7 @@ func loadComposeFile(file string, c *cli.Context) 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 {
|
||||||
// TODO: mapping composeObject config to komposeObject config
|
// TODO: mapping composeObject config to komposeObject config
|
||||||
|
checkUnsupportedKey(composeServiceConfig)
|
||||||
serviceConfig := ServiceConfig{}
|
serviceConfig := ServiceConfig{}
|
||||||
serviceConfig.Image = composeServiceConfig.Image
|
serviceConfig.Image = composeServiceConfig.Image
|
||||||
serviceConfig.ContainerName = composeServiceConfig.ContainerName
|
serviceConfig.ContainerName = composeServiceConfig.ContainerName
|
||||||
@ -800,7 +812,7 @@ func komposeConvert(komposeObject KomposeObject, toStdout, createD, createRS, cr
|
|||||||
for name, service := range komposeObject.ServiceConfigs {
|
for name, service := range komposeObject.ServiceConfigs {
|
||||||
svcnames = append(svcnames, name)
|
svcnames = append(svcnames, name)
|
||||||
|
|
||||||
checkUnsupportedKey(service)
|
//checkUnsupportedKey(service)
|
||||||
|
|
||||||
rc := initRC(name, service, replicas)
|
rc := initRC(name, service, replicas)
|
||||||
sc := initSC(name, service)
|
sc := initSC(name, service)
|
||||||
@ -1035,7 +1047,7 @@ func Convert(c *cli.Context) {
|
|||||||
komposeConvert(komposeObject, toStdout, createD, createRS, createDS, createChart, createDeploymentConfig, generateYaml, replicas, inputFile, outFile, f)
|
komposeConvert(komposeObject, toStdout, createD, createRS, createDS, createChart, createDeploymentConfig, generateYaml, replicas, inputFile, outFile, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkUnsupportedKey(service ServiceConfig) {
|
func checkUnsupportedKey(service interface{}) {
|
||||||
s := structs.New(service)
|
s := structs.New(service)
|
||||||
for _, f := range s.Fields() {
|
for _, f := range s.Fields() {
|
||||||
if f.IsExported() && !f.IsZero() {
|
if f.IsExported() && !f.IsZero() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user