apache / rocketmq-operator

Apache RocketMQ Operator
https://rocketmq.apache.org/
Apache License 2.0
314 stars 127 forks source link

DeepCopy objects missing #26

Closed AdheipSingh closed 4 years ago

AdheipSingh commented 4 years ago

BUG REPORT

  1. Please describe the issue you observed: I was trying to run the operator locally using operator-sdk run --local, due to the deepcopy objects not present in the master, i was not able to run it locally. Here is an error log

    operator-sdk run --local
    INFO[0000] Running the operator locally in namespace default. 
    # github.com/apache/rocketmq-operator/pkg/apis/rocketmq/v1alpha1
    pkg/apis/rocketmq/v1alpha1/broker_types.go:90:25: cannot use &Broker literal (type *Broker) as type runtime.Object in argument to SchemeBuilder.Register:
        *Broker does not implement runtime.Object (missing DeepCopyObject method)
    pkg/apis/rocketmq/v1alpha1/broker_types.go:90:36: cannot use &BrokerList literal (type *BrokerList) as type runtime.Object in argument to SchemeBuilder.Register:
        *BrokerList does not implement runtime.Object (missing DeepCopyObject method)
    pkg/apis/rocketmq/v1alpha1/nameservice_types.go:81:25: cannot use &NameService literal (type *NameService) as type runtime.Object in argument to SchemeBuilder.Register:
        *NameService does not implement runtime.Object (missing DeepCopyObject method)
    pkg/apis/rocketmq/v1alpha1/nameservice_types.go:81:41: cannot use &NameServiceList literal (type *NameServiceList) as type runtime.Object in argument to SchemeBuilder.Register:
        *NameServiceList does not implement runtime.Object (missing DeepCopyObject method)
    pkg/apis/rocketmq/v1alpha1/topictransfer_types.go:73:25: cannot use &TopicTransfer literal (type *TopicTransfer) as type runtime.Object in argument to SchemeBuilder.Register:
        *TopicTransfer does not implement runtime.Object (missing DeepCopyObject method)
    pkg/apis/rocketmq/v1alpha1/topictransfer_types.go:73:43: cannot use &TopicTransferList literal (type *TopicTransferList) as type runtime.Object in argument to SchemeBuilder.Register:
        *TopicTransferList does not implement runtime.Object (missing DeepCopyObject method)
    • What did you see instead?
    • after running operator-sdk generate k8s, i was able to generate deepcopy objects and run it locally
  2. Please tell us about your environment:

    operator-sdk version: "v0.16.0", commit: "55f1446c5f472e7d8e308dcdf36d0d7fc44fc4fd", go version: "go1.13.8 linux/amd64"

    FEATURE REQUEST

  3. Please describe the feature you are requesting.

    • Deepcopy objects should be present in the repo itself. Any specific reason for not including in repo ?
liuruiyiyang commented 4 years ago

Hi, AdheipSingh. Since the deepcopy files are generated by the operator-sdk, it is generally not committed to the repository for project cleanness. I suggest that you follow the Develop steps in README to generate related files. Thanks for your feedbacks :)