Skip to content

Commit

Permalink
feat: allow passing additional arguments to k9s when invoked by `zarf…
Browse files Browse the repository at this point in the history
… tools monitor` (#2095)

## Description
Allow additional arguments to be passed to k9s

Fixes #2094

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

Co-authored-by: Wayne Starr <[email protected]>
  • Loading branch information
WeaponX314 and Racer159 authored Nov 7, 2023
1 parent 54314a8 commit 64e8857
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cmd/tools/k9s.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ import (

func init() {
k9sCmd := &cobra.Command{
Use: "monitor",
Aliases: []string{"m", "k9s"},
Short: lang.CmdToolsMonitorShort,
Use: "monitor",
Aliases: []string{"m", "k9s"},
Short: lang.CmdToolsMonitorShort,
DisableFlagParsing: true,
Run: func(cmd *cobra.Command, args []string) {
// Hack to make k9s think it's all alone
os.Args = []string{os.Args[0]}
// Pass the rest of the arguments to k9s
os.Args = append(os.Args, args...)
k9s.Execute()
},
}
Expand Down

0 comments on commit 64e8857

Please sign in to comment.