Skip to content

Failed to compile the OpenTelemetry Collector with k8s.io/client-go v0.33.1 or above #42640

@skferdose

Description

@skferdose

Component(s)

processor/k8sattributes

What happened?

Description

The OpenTelemetry Collector distribution compile fails with following error when we use k8s.io/client-go v0.33.1 or above versions.

Error: failed to compile the OpenTelemetry Collector distribution: go subcommand failed with args '[build -trimpath -o otelcol-eric-bam -ldflags=-s -w -gcflags=]': exit status 1, error message: # github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor/internal/kube
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:30:9: cannot use &FakeInformer{…} (value of type *FakeInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *FakeInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:63:9: cannot use f.FakeController (variable of type *FakeController) as "k8s.io/client-go/tools/cache".Controller value in return statement: *FakeController does not implement "k8s.io/client-go/tools/cache".Controller (missing method RunWithContext)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:73:9: cannot use &FakeInformer{…} (value of type *FakeInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *FakeInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:88:9: cannot use f.FakeController (variable of type *FakeController) as "k8s.io/client-go/tools/cache".Controller value in return statement: *FakeController does not implement "k8s.io/client-go/tools/cache".Controller (missing method RunWithContext)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:99:9: cannot use &FakeInformer{…} (value of type *FakeInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *FakeInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:118:9: cannot use f.FakeController (variable of type *FakeController) as "k8s.io/client-go/tools/cache".Controller value in return statement: *FakeController does not implement "k8s.io/client-go/tools/cache".Controller (missing method RunWithContext)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:158:9: cannot use &NoOpInformer{…} (value of type *NoOpInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *NoOpInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:167:9: cannot use &NoOpInformer{…} (value of type *NoOpInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *NoOpInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)

Steps to Reproduce

  • Use k8s.io/client-go v0.33.0
  • The Opentelemetry compile fails with the mentioned error.

Expected Result

  • Support for dependency with newer version of k8s.io

Actual Result

  • It supports till k8s.io v0.32.3. New version of k8s.io causing failure.

Collector version

v0.133.0

Environment information

Environment

OS: Ubuntu 22
Compiler(if manually compiled): go 1.25

OpenTelemetry Collector configuration

Log output

Error: failed to compile the OpenTelemetry Collector distribution: go subcommand failed with args '[build -trimpath -o otelcol-eric-bam -ldflags=-s -w -gcflags=]': exit status 1, error message: # github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor/internal/kube
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:30:9: cannot use &FakeInformer{…} (value of type *FakeInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *FakeInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:63:9: cannot use f.FakeController (variable of type *FakeController) as "k8s.io/client-go/tools/cache".Controller value in return statement: *FakeController does not implement "k8s.io/client-go/tools/cache".Controller (missing method RunWithContext)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:73:9: cannot use &FakeInformer{…} (value of type *FakeInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *FakeInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:88:9: cannot use f.FakeController (variable of type *FakeController) as "k8s.io/client-go/tools/cache".Controller value in return statement: *FakeController does not implement "k8s.io/client-go/tools/cache".Controller (missing method RunWithContext)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:99:9: cannot use &FakeInformer{…} (value of type *FakeInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *FakeInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:118:9: cannot use f.FakeController (variable of type *FakeController) as "k8s.io/client-go/tools/cache".Controller value in return statement: *FakeController does not implement "k8s.io/client-go/tools/cache".Controller (missing method RunWithContext)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:158:9: cannot use &NoOpInformer{…} (value of type *NoOpInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *NoOpInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)
/tmp/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.133.0/internal/kube/fake_informer.go:167:9: cannot use &NoOpInformer{…} (value of type *NoOpInformer) as "k8s.io/client-go/tools/cache".SharedInformer value in return statement: *NoOpInformer does not implement "k8s.io/client-go/tools/cache".SharedInformer (missing method AddEventHandlerWithOptions)

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filedependency issuehelp wantedExtra attention is needednever staleIssues marked with this label will be never staled and automatically removedpriority:p0Criticalprocessor/k8sattributesk8s Attributes processor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions