Added --controller feature

Previously we used to mention controller type as `--deployment`,
`--replication-controller` or `--daemonset` as argument.
But now,
it will be like,

ex.

```
kompose convert --controller=daemonset
```
This commit is contained in:
Suraj Narwade
2017-10-04 12:43:45 +05:30
parent 4d4cc3b017
commit 4f8babd623
9 changed files with 799 additions and 6 deletions
+3 -4
View File
@@ -507,14 +507,13 @@ func (k *Kubernetes) CreateKubernetesObjects(name string, service kobject.Servic
log.Warning("Global mode not yet supported, containers will only be replicated once throughout the cluster. DaemonSet support will be added in the future.")
replica = 1
}
if opt.CreateD {
if opt.CreateD || opt.Controller == "deployment" {
objects = append(objects, k.InitD(name, service, replica))
}
if opt.CreateDS {
if opt.CreateDS || opt.Controller == "daemonset" {
objects = append(objects, k.InitDS(name, service))
}
if opt.CreateRC {
if opt.CreateRC || opt.Controller == "replicationcontroller" {
objects = append(objects, k.InitRC(name, service, replica))
}