From b3466679125d335b9e2810fdae9cc01c60609783 Mon Sep 17 00:00:00 2001 From: Tomas Kral Date: Wed, 13 Jul 2016 18:57:52 +0200 Subject: [PATCH] Generate only controllers set by flag --- cli/app/app.go | 5 +++++ cli/command/command.go | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/app/app.go b/cli/app/app.go index 8c3ed404..5ffcde45 100644 --- a/cli/app/app.go +++ b/cli/app/app.go @@ -566,6 +566,11 @@ func ProjectKuberConvert(p *project.Project, c *cli.Context) { createRC := c.BoolT("replicationcontroller") singleOutput := len(outFile) != 0 || toStdout + // Create Deployment by default if no controller has be set + if !createD && !createDS && !createRS && !createRC { + createD = true + } + // Validate the flags if len(outFile) != 0 && toStdout { logrus.Fatalf("Error: --out and --stdout can't be set at the same time") diff --git a/cli/command/command.go b/cli/command/command.go index 2625b0bc..dad7d89e 100644 --- a/cli/command/command.go +++ b/cli/command/command.go @@ -40,8 +40,7 @@ func ConvertCommand(factory app.ProjectFactory) cli.Command { Usage: "Specify file name in order to save objects into", EnvVar: "OUTPUT_FILE", }, - // TODO: validate the flags and make sure only one type is specified - cli.BoolTFlag{ + cli.BoolFlag{ Name: "deployment,d", Usage: "Generate a deployment resource file (default on)", },