ceph / ceph-csi

CSI driver for Ceph
Apache License 2.0
1.29k stars 550 forks source link

rbd: check if mirror image has parent image #4941

Closed yati1998 closed 3 weeks ago

yati1998 commented 3 weeks ago

since enable mirroring fails if it has parent image this commit adds a check for that and returns suitable error which can be picke by VR status

iPraveenParihar commented 3 weeks ago

@yati1998, parent image check is already handled in HandleParentImageExistence() https://github.com/ceph/ceph-csi/blob/c4a1e3a958002a13b1c8a15ad56c6f5195a3eaa7/internal/csi-addons/rbd/replication.go#L309-L322

yati1998 commented 3 weeks ago

@yati1998, parent image check is already handled in HandleParentImageExistence()

https://github.com/ceph/ceph-csi/blob/c4a1e3a958002a13b1c8a15ad56c6f5195a3eaa7/internal/csi-addons/rbd/replication.go#L309-L322

okay, missed it, it seems we need to skip returning grpc error and instead return some meaningful error cc @nixpanic any suggestions on how we can improvise the error?

nixpanic commented 3 weeks ago

okay, missed it, it seems we need to skip returning grpc error and instead return some meaningful error

gRPC functions should return a gRPC error witch codes.* as a status and a message. These are sent over the gRPC protocol back to the caller. The message that is part of the gRPC error should contain as many details as posssible, but user understandable. In the end, these should land in a .Status entry.

yati1998 commented 3 weeks ago

I dont think this change is required as parent existence check it anyways verified. Closing this PR