Skip to content

Commit

Permalink
manifest-templator: ignore unknown parameters
Browse files Browse the repository at this point in the history
In order to share / reuse same command-line parameters for
manifest-templator and tests, making unknown parameters be
ignored.

Signed-off-by: Lukas Bednar <[email protected]>
  • Loading branch information
lukas-bednar committed Dec 17, 2018
1 parent cd09f01 commit 50599b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/manifest-templator/manifest-templator.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
"os"
"path/filepath"
"text/template"

"github.com/spf13/pflag"
)

type templateData struct {
Expand All @@ -44,7 +46,9 @@ func main() {
imagePullPolicy := flag.String("image-pull-policy", "IfNotPresent", "")
genDir := flag.String("generated-manifests-dir", "", "")
inputFile := flag.String("input-file", "", "")
flag.Parse()
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.CommandLine.ParseErrorsWhitelist.UnknownFlags = true
pflag.Parse()

data := templateData{
Namespace: *namespace,
Expand Down

0 comments on commit 50599b9

Please sign in to comment.