From 502b5592dc8f3e59f158d3f126613b9bc0be66cd Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 6 Aug 2024 12:47:07 +0200 Subject: [PATCH] impore logging for invalid driver name improve logging to log both actual and exepect details which helps for debugging. fixes: #53 Signed-off-by: Madhu Rajanna --- internal/controller/driver_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/controller/driver_controller.go b/internal/controller/driver_controller.go index f059378e..1b562d6b 100644 --- a/internal/controller/driver_controller.go +++ b/internal/controller/driver_controller.go @@ -266,7 +266,7 @@ func (r *driverReconcile) LoadAndValidateDesiredState() error { // we assume there is another driver CR with an identical name on some other namespace if r.driver.Namespace != ownerObjKey.Namespace || r.driver.Name != ownerObjKey.Name { err := fmt.Errorf("invalid driver name") - r.log.Error(err, "Desired name already in use by a different CSI Driver") + r.log.Error(err, "Desired name already in use by a CSI Driver in a different namespace", "owner", ownerObjKey, "desired", client.ObjectKeyFromObject(&r.driver)) return err } }