diff --git a/cmd/dependabot/internal/cmd/root.go b/cmd/dependabot/internal/cmd/root.go index ab9c570..cd87c63 100644 --- a/cmd/dependabot/internal/cmd/root.go +++ b/cmd/dependabot/internal/cmd/root.go @@ -15,7 +15,6 @@ var ( file string cache string debugging bool - enableOpenTelemetry bool proxyCertPath string collectorConfigPath string extraHosts []string diff --git a/cmd/dependabot/internal/cmd/test.go b/cmd/dependabot/internal/cmd/test.go index 1f8bbbc..827615c 100644 --- a/cmd/dependabot/internal/cmd/test.go +++ b/cmd/dependabot/internal/cmd/test.go @@ -42,7 +42,6 @@ var testCmd = &cobra.Command{ CollectorImage: collectorImage, Creds: scenario.Input.Credentials, Debug: debugging, - EnableOpenTelemetry: enableOpenTelemetry, Expected: scenario.Output, ExtraHosts: extraHosts, InputName: file, @@ -94,7 +93,6 @@ func init() { testCmd.Flags().StringVar(&collectorConfigPath, "collector-config", "", "path to an OpenTelemetry collector config file") testCmd.Flags().BoolVar(&pullImages, "pull", true, "pull the image if it isn't present") testCmd.Flags().BoolVar(&debugging, "debug", false, "run an interactive shell inside the updater") - testCmd.Flags().BoolVar(&enableOpenTelemetry, "enable-opentelemetry", false, "enable OpenTelemetry tracing") testCmd.Flags().StringArrayVarP(&volumes, "volume", "v", nil, "mount volumes in Docker") testCmd.Flags().StringArrayVar(&extraHosts, "extra-hosts", nil, "Docker extra hosts setting on the proxy") testCmd.Flags().DurationVarP(&timeout, "timeout", "t", 0, "max time to run an update") diff --git a/cmd/dependabot/internal/cmd/update.go b/cmd/dependabot/internal/cmd/update.go index 16380f8..74b5127 100644 --- a/cmd/dependabot/internal/cmd/update.go +++ b/cmd/dependabot/internal/cmd/update.go @@ -66,7 +66,6 @@ func NewUpdateCommand() *cobra.Command { CollectorImage: collectorImage, Creds: input.Credentials, Debug: debugging, - EnableOpenTelemetry: enableOpenTelemetry, Expected: nil, // update subcommand doesn't use expectations ExtraHosts: extraHosts, InputName: file, @@ -102,7 +101,6 @@ func NewUpdateCommand() *cobra.Command { cmd.Flags().StringVar(&collectorConfigPath, "collector-config", "", "path to an OpenTelemetry collector config file") cmd.Flags().BoolVar(&pullImages, "pull", true, "pull the image if it isn't present") cmd.Flags().BoolVar(&debugging, "debug", false, "run an interactive shell inside the updater") - cmd.Flags().BoolVar(&enableOpenTelemetry, "enable-opentelemetry", false, "enable OpenTelemetry tracing") cmd.Flags().StringArrayVarP(&volumes, "volume", "v", nil, "mount volumes in Docker") cmd.Flags().StringArrayVar(&extraHosts, "extra-hosts", nil, "Docker extra hosts setting on the proxy") cmd.Flags().DurationVarP(&timeout, "timeout", "t", 0, "max time to run an update") diff --git a/internal/infra/run.go b/internal/infra/run.go index 4ba91fd..d1f83b4 100644 --- a/internal/infra/run.go +++ b/internal/infra/run.go @@ -46,8 +46,6 @@ type RunParams struct { PullImages bool // run an interactive shell? Debug bool - // EnableOpenTelemetry enables OpenTelemetry tracing - EnableOpenTelemetry bool // Volumes are used to mount directories in Docker Volumes []string // Timeout specifies an optional maximum duration the CLI will run an update. @@ -335,7 +333,7 @@ func runContainers(ctx context.Context, params RunParams, api *server.API) error return err } - if params.EnableOpenTelemetry == true { + if params.CollectorConfigPath != "" { err = pullImage(ctx, cli, params.CollectorImage) if err != nil { return err @@ -365,7 +363,7 @@ func runContainers(ctx context.Context, params RunParams, api *server.API) error go prox.TailLogs(ctx, cli) } - if params.EnableOpenTelemetry { + if params.CollectorConfigPath != "" { collector, err := NewCollector(ctx, cli, networks, ¶ms, prox) if err != nil { return err diff --git a/internal/infra/updater.go b/internal/infra/updater.go index 556acce..533a0be 100644 --- a/internal/infra/updater.go +++ b/internal/infra/updater.go @@ -54,7 +54,7 @@ func NewUpdater(ctx context.Context, cli *client.Client, net *Networks, params * Tty: true, // prevent container from stopping } - if params.EnableOpenTelemetry == true { + if params.CollectorConfigPath != "" { containerCfg.Env = append(containerCfg.Env, "OTEL_ENABLED=true") }