kubectl/pkg/cmd/logs
Ondra Kupka 5172df9638 kubectl/logs: Add LogOptions.RunLogsContext
LogOptions.RunLogs unfortunately registers a signal handler and calls
os.Exit(1) after finished processing when a signal is received. This
makes it basically impossible to call that function from any custom
code.

This patch adds RunLogsContext, which does exactly what RunLogs does,
but the context to be used is passed in. RunLogs retains the current
contract, but it uses RunLogsContext internally, then calls os.Exit(1)
when a signal is received.

Kubernetes-commit: cc4666cc94be41d8b4558122717a2da9fb5a7b1a
2025-07-18 23:35:24 +02:00
..
logs.go kubectl/logs: Add LogOptions.RunLogsContext 2025-07-18 23:35:24 +02:00
logs_test.go Wire context to logs command and add interrupt handler (#127503) 2024-10-22 21:49:06 +03:00