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

cAdvisor to v0.45.0 cannot be imported alongside containerd #3204

Open
brandond opened this issue Nov 30, 2022 · 0 comments
Open

cAdvisor to v0.45.0 cannot be imported alongside containerd #3204

brandond opened this issue Nov 30, 2022 · 0 comments

Comments

@brandond
Copy link

#3145 has completely broken projects like K3s that try to import both Containerd and Kubelet code into the same project. Containerd and the kubelet's cadvisor end up both registering the same types as part of package init. This was not a problem prior to this commit.

2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.Container
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.Container.ExtensionsEntry
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.Container.LabelsEntry
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.Container.Runtime
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.GetContainerRequest
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.GetContainerResponse
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.ListContainersRequest
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.ListContainersResponse
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.CreateContainerRequest
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.CreateContainerResponse
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.UpdateContainerRequest
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.UpdateContainerResponse
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.DeleteContainerRequest
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.services.containers.v1.ListContainerMessage
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.types.Descriptor
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.types.Descriptor.AnnotationsEntry
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.types.Metric
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.types.Mount
2022/11/29 23:49:43 proto: duplicate proto type registered: containerd.types.Platform
panic: proto: duplicate enum registered: containerd.v1.types.Status

goroutine 1 [running]:
github.com/gogo/protobuf/proto.RegisterEnum(...)
	/go/pkg/mod/github.com/gogo/protobuf@v1.3.2/proto/properties.go:520
github.com/google/cadvisor/third_party/containerd/api/types/task.init.0()
	/go/pkg/mod/github.com/google/cadvisor@v0.46.0/third_party/containerd/api/types/task/task.pb.go:161 +0x1a5
	
brandond@dev01:~/go/src/github.com/k3s-io/k3s$ go mod why github.com/google/cadvisor/third_party/containerd/api/types/task
# github.com/google/cadvisor/third_party/containerd/api/types/task
github.com/k3s-io/k3s/pkg/daemons/executor
k8s.io/kubernetes/cmd/kubelet/app
k8s.io/kubernetes/cmd/kubelet/app/options
github.com/google/cadvisor/container/containerd
github.com/google/cadvisor/third_party/containerd/api/types/task

brandond@dev01:~/go/src/github.com/k3s-io/k3s$ go mod why github.com/containerd/containerd/api/types
# github.com/containerd/containerd/api/types
github.com/k3s-io/k3s/pkg/agent/containerd
github.com/containerd/containerd
github.com/containerd/containerd/api/types

Originally posted by @brandond in #3145 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant