Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add debug flag to ShellToContainerCmd for enhanced troubleshooting #236

Merged
merged 1 commit into from
Feb 5, 2025
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
4 changes: 4 additions & 0 deletions tsuru/client/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var httpRegexp = regexp.MustCompile(`^http`)
type ShellToContainerCmd struct {
tsuruClientApp.AppNameMixIn
isolated bool
debug bool
fs *gnuflag.FlagSet
}

Expand All @@ -49,6 +50,8 @@ func (c *ShellToContainerCmd) Flags() *gnuflag.FlagSet {
help := "Run shell in a new unit"
c.fs.BoolVar(&c.isolated, "isolated", false, help)
c.fs.BoolVar(&c.isolated, "i", false, help)
c.fs.BoolVar(&c.debug, "debug", false, "Enable debug mode")
c.fs.BoolVar(&c.debug, "d", false, "Enable debug mode")
}
return c.fs
}
Expand Down Expand Up @@ -97,6 +100,7 @@ func (c *ShellToContainerCmd) Run(context *cmd.Context) error {
}
queryString := make(url.Values)
queryString.Set("isolated", strconv.FormatBool(c.isolated))
queryString.Set("debug", strconv.FormatBool(c.debug))
queryString.Set("width", strconv.Itoa(width))
queryString.Set("height", strconv.Itoa(height))
if len(context.Args) > 0 {
Expand Down
Loading