diff --git a/cmd/tide/engine.go b/cmd/tide/engine.go index 43235a2..bb876d7 100644 --- a/cmd/tide/engine.go +++ b/cmd/tide/engine.go @@ -11,8 +11,8 @@ import ( var env = environment.New() -func readManifest(installArg string) (string, error) { - chfi, err := chartutil.LoadChart(installArg) +func readManifest(chart string) (string, error) { + chfi, err := chartutil.LoadChart(chart) if err != nil { return "", err } @@ -37,11 +37,13 @@ func readManifest(installArg string) (string, error) { b := bytes.NewBuffer(nil) for name, file := range files { - // Ignore empty documents because the Kubernetes library can't handle - // them. - if len(file) > 0 { - b.WriteString("\n---\n# Source: " + name + "\n") - b.WriteString(file) + if manifest_file == "" || manifest_file == name { + // Ignore empty documents because the Kubernetes library can't handle + // them. + if len(file) > 0 { + b.WriteString("\n---\n# Source: " + name + "\n") + b.WriteString(file) + } } } diff --git a/cmd/tide/render.go b/cmd/tide/render.go index 0bc44c4..19b16db 100644 --- a/cmd/tide/render.go +++ b/cmd/tide/render.go @@ -41,5 +41,6 @@ func setupRenderEnv(args []string) { func init() { renderCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose render") + renderCmd.Flags().StringVarP(&manifest_file, "file", "f", "", "view manifest file") RootCommand.AddCommand(renderCmd) } diff --git a/cmd/tide/tide.go b/cmd/tide/tide.go index 82f3481..90a5858 100644 --- a/cmd/tide/tide.go +++ b/cmd/tide/tide.go @@ -16,6 +16,8 @@ var ( watch bool // delete enables automatic deletion on exit deletion bool + // manifest file + manifest_file string ) var globalUsage = `The Kubernetes package renderer