apache / rocketmq-operator

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

lost "volumeClaimTemplates>metadata>name "'s value after apply yaml, this issue cause recreate pvc when redeploy. #117

Closed feiyuyitiao closed 2 years ago

feiyuyitiao commented 2 years ago

after deploy, view k8s sts broker-0-master or broker-0-replica-1, it miss " volumeClaimTemplates (name: namesrv-storage" or "storageClassName: rocketmq-storage") which defined in template file rocketmq_v1alpha1_rocketmq_cluster.yaml. from bellow snapshot, operator generator a new name. this issue cause recreate pvc when redeploy. image

temp fix by: pkg/controller/nameservice/nameservice_controller.go:257 , method: getVolumeClaimTemplates() ...... templates := nameService.Spec.VolumeClaimTemplates templates[0].ObjectMeta.Name = "namesrv-storage" return templates ....... pkg/controller/broker/broker_controller.go:507 , method: getVolumeClaimTemplates() ..... templates := broker.Spec.VolumeClaimTemplates templates[0].ObjectMeta.Name = "broker-storage" return templates .....

feiyuyitiao commented 2 years ago

I found the 'https://github.com/apache/rocketmq-operator/pull/116' fixed yesterday. so I add change " crd:generateEmbeddedObjectMeta=true " in manifests: controller-gen, fix currentissue. thanks!

sorry, I dont' familar with operatorframework.

caigy commented 2 years ago

Solved by #116