diff --git a/internal/config/main.go b/internal/config/main.go index 359d583dfa..dae27bb721 100644 --- a/internal/config/main.go +++ b/internal/config/main.go @@ -19,7 +19,6 @@ import ( "time" "github.com/go-logr/logr" - "github.com/spf13/pflag" logf "sigs.k8s.io/controller-runtime/pkg/log" "github.com/open-telemetry/opentelemetry-operator/internal/version" @@ -85,18 +84,6 @@ func New(opts ...Option) Config { } } -// FlagSet binds the flags to the user-modifiable values of the operator's configuration. -func (c *Config) FlagSet() *pflag.FlagSet { - fs := pflag.NewFlagSet("opentelemetry-operator", pflag.ExitOnError) - pflag.StringVar(&c.collectorImage, - "otelcol-image", - c.collectorImage, - "The default image to use for OpenTelemetry Collector when not specified in the individual custom resource (CR)", - ) - - return fs -} - // StartAutoDetect attempts to automatically detect relevant information for this operator. This will block until the first // run is executed and will schedule periodic updates. func (c *Config) StartAutoDetect() error { diff --git a/main.go b/main.go index 62f7a664da..6c0011916d 100644 --- a/main.go +++ b/main.go @@ -89,6 +89,7 @@ func main() { pflag.StringVar(&autoInstrumentationJava, "auto-instrumentation-java-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:%s", v.AutoInstrumentationJava), "The default OpenTelemetry Java instrumentation image. This image is used when no image is specified in the CustomResource.") pflag.StringVar(&autoInstrumentationNodeJS, "auto-instrumentation-nodejs-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs:%s", v.AutoInstrumentationNodeJS), "The default OpenTelemetry NodeJS instrumentation image. This image is used when no image is specified in the CustomResource.") pflag.StringVar(&autoInstrumentationPython, "auto-instrumentation-python-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:%s", v.AutoInstrumentationPython), "The default OpenTelemetry Python instrumentation image. This image is used when no image is specified in the CustomResource.") + pflag.Parse() logger := zap.New(zap.UseFlagOptions(&opts)) ctrl.SetLogger(logger) @@ -126,10 +127,6 @@ func main() { config.WithAutoDetect(ad), ) - pflag.CommandLine.AddFlagSet(cfg.FlagSet()) - - pflag.Parse() - watchNamespace, found := os.LookupEnv("WATCH_NAMESPACE") if found { setupLog.Info("watching namespace(s)", "namespaces", watchNamespace)