From 1485c8c464df05e227967ecf3f9ea374da0c7650 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Wed, 10 Apr 2019 15:57:03 +0200 Subject: [PATCH] Stop logging broadcasted events in the operator And just broadcast the chart was synced, without implying success, as the event will always fire regardless of the sync outcome. --- integrations/helm/operator/operator.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/integrations/helm/operator/operator.go b/integrations/helm/operator/operator.go index cc6dcb9fd..30761ab67 100644 --- a/integrations/helm/operator/operator.go +++ b/integrations/helm/operator/operator.go @@ -7,7 +7,6 @@ import ( "time" "github.com/go-kit/kit/log" - "github.com/golang/glog" "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" @@ -40,12 +39,9 @@ const ( // a HelmRelease fails to be released/updated ErrChartSync = "ErrChartSync" - // MessageChartSynced - the message used for Events when a resource - // fails to sync due to failing to release the Chart - MessageChartSynced = "Chart managed by HelmRelease processed successfully" - // MessageErrChartSync - the message used for an Event fired when a HelmRelease - // is synced successfully - MessageErrChartSync = "Chart %s managed by HelmRelease failed to be processed" + // MessageChartSynced - the message used for an Event fired when a HelmRelease + // is synced. + MessageChartSynced = "Chart managed by HelmRelease processed" ) // Controller is the operator implementation for HelmRelease resources @@ -83,7 +79,6 @@ func New( // logged for helm-operator types. ifscheme.AddToScheme(scheme.Scheme) eventBroadcaster := record.NewBroadcaster() - eventBroadcaster.StartLogging(glog.Infof) eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeclientset.CoreV1().Events("")}) recorder := eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerAgentName})