This is an automated email from the ASF dual-hosted git repository. squakez pushed a commit to branch v3 in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 84b67ce1724ebe7dfc0f4020fa79eeb62905df34 Author: Suhail Hany <[email protected]> AuthorDate: Sun Oct 25 12:56:35 2026 +0300 Fix #6843: merge RootCmdOptions.RootContext into Context Since #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. --- pkg/cmd/root.go | 18 ++++++++---------- pkg/cmd/run.go | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go index 24cffb176..54e1fa2c5 100644 --- a/pkg/cmd/root.go +++ b/pkg/cmd/root.go @@ -40,21 +40,19 @@ superpowers. // //nolint:containedctx type RootCmdOptions struct { - RootContext context.Context `mapstructure:"-"` - Context context.Context `mapstructure:"-"` - _client client.Client `mapstructure:"-"` - Flags *viper.Viper `mapstructure:"-"` - KubeConfig string `mapstructure:"kube-config"` - Namespace string `mapstructure:"namespace"` - Verbose bool `mapstructure:"verbose" yaml:",omitempty"` + Context context.Context `mapstructure:"-"` + _client client.Client `mapstructure:"-"` + Flags *viper.Viper `mapstructure:"-"` + KubeConfig string `mapstructure:"kube-config"` + Namespace string `mapstructure:"namespace"` + Verbose bool `mapstructure:"verbose" yaml:",omitempty"` } // NewKamelCommand --. func NewKamelCommand(ctx context.Context) (*cobra.Command, error) { options := RootCmdOptions{ - RootContext: ctx, - Context: ctx, - Flags: viper.New(), + Context: ctx, + Flags: viper.New(), } cmd := kamelPreAddCommandInit(&options) diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index b32f42f72..d1cd83054 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -370,7 +370,7 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args []string) error { return err } // Let's add a Wait point, otherwise the script terminates - <-o.RootContext.Done() + <-o.Context.Done() } return nil
