Laura Brehm 650a7af0ae
cobra/commands: cancel command context on signal
See https://github.com/docker/cli/pull/4599 and
https://github.com/docker/cli/pull/4769.

Since we switched to using the cobra command context instead of
`appcontext`, we need to set up the signal handling that was being
provided by `appcontext`, as well as configuring the context with
the OTEL tracing utilities also used by `appcontext`.

This commit introduces `cobrautil.ConfigureContext` which implements
the pre-existing signal handling logic from `appcontext` and cancels
the command's context when a signal is received, as well as doing
the relevant OTEL config.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-01-19 16:30:52 -08:00
..
2019-03-22 16:27:37 -07:00
2023-03-14 18:44:13 +01:00
2023-11-22 21:11:24 +01:00
2019-03-22 16:27:37 -07:00
2023-11-22 21:11:24 +01:00
2019-11-21 10:30:39 +09:00