From 34ace167dc192f3b40f1f630359035bdc4b871c0 Mon Sep 17 00:00:00 2001 From: yuyi Date: Tue, 14 Nov 2023 14:44:18 +0800 Subject: [PATCH 1/2] fix(sentry): set annotations of object to nil --- pkg/telemetry/sentry.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/telemetry/sentry.go b/pkg/telemetry/sentry.go index 01bf3985f..200499b4d 100644 --- a/pkg/telemetry/sentry.go +++ b/pkg/telemetry/sentry.go @@ -33,6 +33,7 @@ func objectSentry(object any) { if metaObj, ok := object.(metav1.Object); ok { // remove managed fields which are of no interest metaObj.SetManagedFields(nil) + metaObj.SetAnnotations(nil) // annotations may be privacy sensitive } if cluster, ok := object.(*v1alpha1.OBCluster); ok { From 7fde770394a16bd1874b8a5ebb6a14c1d86fdc66 Mon Sep 17 00:00:00 2001 From: yuyi Date: Tue, 14 Nov 2023 14:47:23 +0800 Subject: [PATCH 2/2] fix: comments and owns --- pkg/controller/obcluster_controller.go | 1 + pkg/controller/obzone_controller.go | 1 + pkg/resource/coordinator.go | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/controller/obcluster_controller.go b/pkg/controller/obcluster_controller.go index f71ef5b9d..ffc274db7 100644 --- a/pkg/controller/obcluster_controller.go +++ b/pkg/controller/obcluster_controller.go @@ -94,6 +94,7 @@ func (r *OBClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( func (r *OBClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&v1alpha1.OBCluster{}). + Owns(&v1alpha1.OBZone{}). WithEventFilter(preds). Complete(r) } diff --git a/pkg/controller/obzone_controller.go b/pkg/controller/obzone_controller.go index f64fcb3b3..d40d27c20 100644 --- a/pkg/controller/obzone_controller.go +++ b/pkg/controller/obzone_controller.go @@ -86,6 +86,7 @@ func (r *OBZoneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr func (r *OBZoneReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&v1alpha1.OBZone{}). + Owns(&v1alpha1.OBServer{}). WithEventFilter(preds). Complete(r) } diff --git a/pkg/resource/coordinator.go b/pkg/resource/coordinator.go index b52f1a4c3..15f329e9e 100644 --- a/pkg/resource/coordinator.go +++ b/pkg/resource/coordinator.go @@ -26,9 +26,9 @@ import ( ) const ( - // If no task flow, requeue after 60 sec. + // If no task flow, requeue after 30 sec. NormalRequeueDuration = 30 * time.Second - // In task flow, requeue after 500 ms. + // In task flow, requeue after 1 sec. ExecutionRequeueDuration = 1 * time.Second )