Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(kumactl) add install tracing context #2343

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/kumactl/cmd/install/context/install_tracing_context.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package context

type TracingTemplateArgs struct {
Namespace string
}

type InstallTracingContext struct {
TemplateArgs TracingTemplateArgs
}

func DefaultInstallTracingContext() InstallTracingContext {
return InstallTracingContext{
TemplateArgs: TracingTemplateArgs{
Namespace: "kuma-tracing",
},
}
}
2 changes: 1 addition & 1 deletion app/kumactl/cmd/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewInstallCmd(pctx *kumactl_cmd.RootContext) *cobra.Command {
cmd.AddCommand(newInstallControlPlaneCmd(&pctx.InstallCpContext))
cmd.AddCommand(newInstallCrdsCmd(&pctx.InstallCRDContext))
cmd.AddCommand(newInstallMetrics(pctx))
cmd.AddCommand(newInstallTracing())
cmd.AddCommand(newInstallTracing(pctx))
cmd.AddCommand(newInstallDNS())
cmd.AddCommand(newInstallLogging())
cmd.AddCommand(newInstallTransparentProxy())
Expand Down
10 changes: 4 additions & 6 deletions app/kumactl/cmd/install/install_tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

kumactl_cmd "github.com/kumahq/kuma/app/kumactl/pkg/cmd"

kumactl_data "github.com/kumahq/kuma/app/kumactl/data"
"github.com/kumahq/kuma/app/kumactl/pkg/install/data"
"github.com/kumahq/kuma/app/kumactl/pkg/install/k8s"
Expand All @@ -13,12 +15,8 @@ type tracingTemplateArgs struct {
Namespace string
}

func newInstallTracing() *cobra.Command {
args := struct {
Namespace string
}{
Namespace: "kuma-tracing",
}
func newInstallTracing(pctx *kumactl_cmd.RootContext) *cobra.Command {
args := pctx.InstallTracingContext.TemplateArgs
cmd := &cobra.Command{
Use: "tracing",
Short: "Install Tracing backend in Kubernetes cluster (Jaeger)",
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/pkg/cmd/root_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type RootContext struct {
InstallDemoContext install_context.InstallDemoContext
InstallGatewayKongContext install_context.InstallGatewayKongContext
InstallGatewayKongEnterpriseContext install_context.InstallGatewayKongEnterpriseContext
InstallTracingContext install_context.InstallTracingContext
}

func DefaultRootContext() *RootContext {
Expand Down Expand Up @@ -97,6 +98,7 @@ func DefaultRootContext() *RootContext {
InstallDemoContext: install_context.DefaultInstallDemoContext(),
InstallGatewayKongContext: install_context.DefaultInstallGatewayKongContext(),
InstallGatewayKongEnterpriseContext: install_context.DefaultInstallGatewayKongEnterpriseContext(),
InstallTracingContext: install_context.DefaultInstallTracingContext(),
}
}

Expand Down