Skip to content

Fix #6843: merge RootCmdOptions.RootContext into Context - #6918

Open
Suhail98 wants to merge 1 commit into
apache:mainfrom
Suhail98:fix-6843-single-context
Open

Suhail98 wants to merge 1 commit into
apache:mainfrom
Suhail98:fix-6843-single-context

Conversation

@Suhail98

Copy link
Copy Markdown
Contributor

Fixes #6843

RootCmdOptions carries two contexts that now always hold the same value. RootContext used to keep the process alive while kamel run --sync cancelled and reran the command through Context. #6832 removed --sync, and since then NewKamelCommand sets both fields to the same ctx. Two names for one value leave readers guessing which to use.

  • Drop the RootContext field and its assignment in NewKamelCommand.
  • The wait point after kamel run --logs now blocks on o.Context.Done(). It was the only RootContext reader, and kamel log already waits the same way.

No behaviour change: both fields held the same ctx, so the wait blocks on the same channel as before. The unit-test fixtures in root_test.go already set only Context.

Testing

go build, go vet (including the integration-tagged e2e packages) and gofmt are clean, and golangci-lint reports nothing in the touched files. go test ./pkg/cmd/... shows the same pre-existing Windows-only failures before and after the change.

Since apache#6832 dropped the cancellable child context that kamel run --sync
used, NewKamelCommand sets RootContext and Context to the same ctx. Keep
Context and move the only RootContext reader, the wait point after
kamel run --logs, over to it. Both fields held the same value, so the
wait blocks on the same channel as before.

This branch has not been deployed

No deployments
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.

Merge RootCmdOptions.RootContext and Context into a single field

1 participant