From d6ff4c00375e3dea3e7f90c7761e49dd6ea91736 Mon Sep 17 00:00:00 2001 From: bdjgs <104349651+bdjgs@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:57:05 +0100 Subject: [PATCH] :children_crossing: update misleading logging in library controller (#216) --- internal/controller/styra/library_controller.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/controller/styra/library_controller.go b/internal/controller/styra/library_controller.go index 13aa77a..2aa3850 100644 --- a/internal/controller/styra/library_controller.go +++ b/internal/controller/styra/library_controller.go @@ -272,7 +272,7 @@ func (r *LibraryReconciler) reconcileSubjects( log logr.Logger, k8sLib *styrav1alpha1.Library, ) (ctrl.Result, error) { - log.Info("Reconciling subjects for library") + log.Info("Reconciling subjects and rolebindings for library") // Make sure all users already exist in Styra, otherwise create them if err := r.createUsersIfMissing(ctx, log, k8sLib); err != nil { @@ -326,7 +326,7 @@ func (r *LibraryReconciler) deleteIncorrectRoleBindings( ctx context.Context, log logr.Logger, k8sLib *styrav1alpha1.Library) error { - log.Info("Deleting Rolebindings to roles that are not LibraryViewers") + log.Info("Checking for Rolebindings to roles that are not LibraryViewers") res, err := r.Styra.ListRoleBindingsV2(ctx, &styra.ListRoleBindingsV2Params{ ResourceKind: styra.RoleBindingKindLibrary, ResourceID: k8sLib.Spec.Name, @@ -337,6 +337,7 @@ func (r *LibraryReconciler) deleteIncorrectRoleBindings( for _, styraRB := range res.Rolebindings { if styraRB.RoleID != styra.Role("LibraryViewer") { + log.Info(fmt.Sprintf("Deleting Rolebinding to %s", styraRB.RoleID)) if _, err := r.Styra.DeleteRoleBindingV2(ctx, styraRB.ID); err != nil { return err }