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

got error when import pkg/apis/rocketmq to get broker list #168

Closed
drivebyer opened this issue Aug 7, 2023 · 0 comments · Fixed by #169
Closed

got error when import pkg/apis/rocketmq to get broker list #168

drivebyer opened this issue Aug 7, 2023 · 0 comments · Fixed by #169

Comments

@drivebyer
Copy link
Contributor

Hello Developers,

I am using the rocketmq-operator to manage multiple rocketmq clusters. I plan to write a management tool in Go to carry out some other operations. My approach is to import the pkg/apis/rocketmq package, then use client-go to get the current broker clusters in k8s. The code looks something like this:

data := &operatorv1alpha1.Broker{
	ObjectMeta: metav1.ObjectMeta{
		Name:      req.Name,
		Namespace: req.Namespace,
	},
}
err = client.Get(ctx, client.ObjectKeyFromObject(data), data)
if err != nil {
	return nil, err
}

However, I am getting an error message:

Cannot use 'data' (type *operatorv1alpha1.Broker) as the type Object Type does not implement 'Object' as some methods are missing: DeepCopyObject() Object

I later realized this is because certain relevant files were ignored during upload. See

**/zz_generated.deepcopy.go

I suggest that these files be uploaded to the GitHub repository, so that third-party users can more conveniently refer to this api module.

drivebyer added a commit to drivebyer/rocketmq-operator that referenced this issue Aug 7, 2023
drivebyer added a commit to drivebyer/rocketmq-operator that referenced this issue Aug 10, 2023
drivebyer added a commit to drivebyer/rocketmq-operator that referenced this issue Aug 10, 2023
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

Successfully merging a pull request may close this issue.

1 participant