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

Add rpaas debug feature with custom image #136

Merged
merged 11 commits into from
Aug 8, 2023

Conversation

morpheu
Copy link
Member

@morpheu morpheu commented Aug 2, 2023

No description provided.

Copy link
Member

@nettoclaudio nettoclaudio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some in-line request changes 💅 but LGTM

Comment on lines +50 to +59
&cli.BoolFlag{
Name: "interactive",
Aliases: []string{"I", "stdin"},
Usage: "pass STDIN to container",
},
&cli.BoolFlag{
Name: "tty",
Aliases: []string{"t"},
Usage: "allocate a pseudo-TTY",
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd force the interactive mode (tty + interactive) in this sub-command... I think there's no other user case to use it without an interactive session.

internal/pkg/rpaas/k8s.go Outdated Show resolved Hide resolved
Comment on lines +150 to +152
if status.State.Terminated != nil {
req := m.kcs.CoreV1().Pods(instance.Namespace).GetLogs(args.Pod, &corev1.PodLogOptions{Container: debugContainerName})
return logs.DefaultConsumeRequest(req, args.Stdout)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible I overlooked something however I really didn't get it... Why should we see the logs if pod is the termination phase?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause it's possible to send a command and not enter in interact mode with debug container. In this case scenario container enter in terminated state and code throw to user container logs related to the command sent (this feature its similar how kubectl debug works in this scenario)

internal/pkg/rpaas/k8s.go Outdated Show resolved Hide resolved
@@ -0,0 +1,165 @@
package web
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing license header.

morpheu and others added 3 commits August 7, 2023 17:50
Co-authored-by: Claudio Netto <nettoclaudio@ufrj.br>
Co-authored-by: Claudio Netto <nettoclaudio@ufrj.br>
Copy link
Contributor

@crgisch crgisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if nerr != nil {
closeErr, ok := nerr.(*websocket.CloseError)
if !ok {
done <- fmt.Errorf("ERROR: receveid an unexpected error while reading messages: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo:
"ERROR: received an unexpected..."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦅 eyes :)
thanks!

@morpheu morpheu merged commit cdbed04 into tsuru:main Aug 8, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants