Skip to content

Commit

Permalink
Added '-f' flag to view specific manifest file instead of entire chart
Browse files Browse the repository at this point in the history
  • Loading branch information
dkapanidis committed Jun 7, 2016
1 parent ab2a0ab commit 736fc5b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cmd/tide/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
}
}
}

Expand Down
1 change: 1 addition & 0 deletions cmd/tide/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 2 additions & 0 deletions cmd/tide/tide.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 736fc5b

Please sign in to comment.