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

go.opentelemetry.io/otel/trace broken when scaffolding webhook #6693

Closed
criscola opened this issue Mar 5, 2024 · 4 comments
Closed

go.opentelemetry.io/otel/trace broken when scaffolding webhook #6693

criscola opened this issue Mar 5, 2024 · 4 comments
Labels
language/go Issue is related to a Go operator project lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Milestone

Comments

@criscola
Copy link

criscola commented Mar 5, 2024

Bug Report

What did you do?

I generated a webhook with operator-sdk create webhook --group group --version v1alpha1 --kind Resource --programmatic-validation

What did you expect to see?

I then ran make run and expected the operator to run.

What did you see instead? Under which circumstances?

go fmt ./...
go vet ./...
# go.opentelemetry.io/otel/sdk/trace
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/provider.go:90:30: cannot use &TracerProvider{} (value of type *TracerProvider) as "go.opentelemetry.io/otel/trace".TracerProvider value in variable declaration: *TracerProvider does not implement "go.opentelemetry.io/otel/trace".TracerProvider (missing method tracerProvider)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/provider.go:170:10: cannot use t (variable of type *tracer) as "go.opentelemetry.io/otel/trace".Tracer value in return statement: *tracer does not implement "go.opentelemetry.io/otel/trace".Tracer (missing method tracer)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/span.go:161:23: cannot use (*recordingSpan)(nil) (value of type *recordingSpan) as ReadWriteSpan value in variable declaration: *recordingSpan does not implement ReadWriteSpan (missing method span)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/span.go:692:9: cannot use s.tracer.provider (variable of type *TracerProvider) as "go.opentelemetry.io/otel/trace".TracerProvider value in return statement: *TracerProvider does not implement "go.opentelemetry.io/otel/trace".TracerProvider (missing method tracerProvider)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/span.go:780:20: cannot use nonRecordingSpan{} (value of type nonRecordingSpan) as "go.opentelemetry.io/otel/trace".Span value in variable declaration: nonRecordingSpan does not implement "go.opentelemetry.io/otel/trace".Span (missing method span)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/span.go:811:74: cannot use s.tracer.provider (variable of type *TracerProvider) as "go.opentelemetry.io/otel/trace".TracerProvider value in return statement: *TracerProvider does not implement "go.opentelemetry.io/otel/trace".TracerProvider (missing method tracerProvider)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/tracer.go:30:22: cannot use &tracer{} (value of type *tracer) as "go.opentelemetry.io/otel/trace".Tracer value in variable declaration: *tracer does not implement "go.opentelemetry.io/otel/trace".Tracer (missing method tracer)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/tracer.go:47:21: impossible type assertion: p.(*recordingSpan)
        *recordingSpan does not implement "go.opentelemetry.io/otel/trace".Span (missing method span)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/tracer.go:117:10: cannot use tr.newNonRecordingSpan(sc) (value of type nonRecordingSpan) as "go.opentelemetry.io/otel/trace".Span value in return statement: nonRecordingSpan does not implement "go.opentelemetry.io/otel/trace".Span (missing method span)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/tracer.go:119:9: cannot use tr.newRecordingSpan(psc, sc, name, samplingResult, config) (value of type *recordingSpan) as "go.opentelemetry.io/otel/trace".Span value in return statement: *recordingSpan does not implement "go.opentelemetry.io/otel/trace".Span (missing method span)
../../../go/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/tracer.go:119:9: too many errors
# git.helio.dev/carbon-aware-scheduling/cabws-workload-controller/api/v1alpha1
# [git.helio.dev/carbon-aware-scheduling/cabws-workload-controller/api/v1alpha1]
vet: api/v1alpha1/webhook_suite_test.go:94:3: unknown field Host in struct literal of type manager.Options
make: *** [Makefile:112: vet] Error 1

Environment

Operator type:

/language go

Kubernetes cluster type:

vanilla

$ operator-sdk version

operator-sdk version: "v1.33.0", commit: "542966812906456a8d67cf7284fc6410b104e118", kubernetes version: "1.27.0", go version: "go1.21.5", GOOS: "linux", GOARCH: "amd64"

$ go version (if language is Go)

go1.22.0

$ kubectl version

Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.2

Possible Solution

I tried to update opentelemetry packages in the go.mod:

go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect
@openshift-ci openshift-ci bot added the language/go Issue is related to a Go operator project label Mar 5, 2024
@jberkhahn
Copy link
Contributor

Can you try downgrading your Golang version ti 1.21.7? We're currently experiencing versioning issues with go 1.22.

@jberkhahn
Copy link
Contributor

relates #6651

@jberkhahn jberkhahn added this to the Backlog milestone Apr 8, 2024
@criscola
Copy link
Author

criscola commented Apr 8, 2024

Hi yes sorry forgot to update the issue, downgrading to go 1.21 fixed the issue

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/go Issue is related to a Go operator project lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants