Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ var Version = "dev"
var (
kubeCfgPath string
ns string
chDir string
plain bool // render without talking to the API server
showOnly []string // template globs for `cozypkg show`
extraVals []string // additional -f/--values files
Expand All @@ -88,9 +89,17 @@ func main() {

root.PersistentFlags().StringVar(&kubeCfgPath, "kubeconfig", "", "Path to kubeconfig")
root.PersistentFlags().StringVarP(&ns, "namespace", "n", "", "Kubernetes namespace (defaults to the current context)")
root.PersistentFlags().StringVarP(&chDir, "working-directory", "C", "", "Root directory of Helm chart to run against (defaults to current directory)")

_ = root.RegisterFlagCompletionFunc("namespace", completeNamespaces)

if chDir != "" {
err := os.Chdir(chDir)
if err != nil {
log.Fatalf("could not chdir to %s: %v", chDir, err)
}
}

root.AddCommand(
cmdShow(),
cmdApply(),
Expand Down
Loading