Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
abuchanan-airbyte committed Sep 5, 2024
1 parent 90d2a84 commit fabc1ea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/cmd/local/local/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ func (c *Command) streamPodLogsToOutput(ctx context.Context, namespace string, p
for scanner.Scan() {
pterm.Debug.Println(scanner.Text())
}

pterm.Debug.Printfln("done streaming logs for %s", podName)
return nil
}
Expand All @@ -607,7 +607,6 @@ func retry(msg string, maxAttempts int, sleep time.Duration, f func() error) {
}
}


// handleEvent converts a kubernetes event into a console log message
func (c *Command) handleEvent(ctx context.Context, e *eventsv1.Event) {
// TODO: replace DeprecatedLastTimestamp,
Expand All @@ -617,7 +616,7 @@ func (c *Command) handleEvent(ctx context.Context, e *eventsv1.Event) {
}

if e.Type == "Normal" && e.Reason == "Started" && e.Regarding.Kind == "Pod" {
go retry(fmt.Sprintf("streaming pod logs for %q", e.Regarding.Name), 5, 2 * time.Second, func() error {
go retry(fmt.Sprintf("streaming pod logs for %q", e.Regarding.Name), 5, 2*time.Second, func() error {
return c.streamPodLogsToOutput(ctx, e.Regarding.Namespace, e.Regarding.Name)
})
}
Expand Down

0 comments on commit fabc1ea

Please sign in to comment.