Skip to content

Commit

Permalink
remove reconciled normal event from channel (#3694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Nichols authored Jul 24, 2020
1 parent 1548f9c commit 27632fe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
9 changes: 1 addition & 8 deletions pkg/reconciler/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"fmt"

"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
apierrs "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -40,12 +39,6 @@ import (
pkgreconciler "knative.dev/pkg/reconciler"
)

// newReconciledNormal makes a new reconciler event with event type Normal, and
// reason ChannelReconciled.
func newReconciledNormal(namespace, name string) pkgreconciler.Event {
return pkgreconciler.NewEvent(corev1.EventTypeNormal, "ChannelReconciled", "Channel reconciled: \"%s/%s\"", namespace, name)
}

type Reconciler struct {
// listers index properties about resources
channelLister listers.ChannelLister
Expand Down Expand Up @@ -92,7 +85,7 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, c *v1beta1.Channel) pkgr
bCS := r.getChannelableStatus(ctx, &backingChannel.Status, backingChannel.Annotations)
c.Status.PropagateStatuses(bCS)

return newReconciledNormal(c.Namespace, c.Name)
return nil
}

func (r *Reconciler) getChannelableStatus(ctx context.Context, bc *duckv1alpha1.ChannelableCombinedStatus, cAnnotations map[string]string) *duckv1beta1.ChannelableStatus {
Expand Down
18 changes: 0 additions & 18 deletions pkg/reconciler/channel/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ func TestReconcile(t *testing.T) {
WithBackingChannelReady,
WithChannelAddress(backingChannelHostname)),
}},
WantEvents: []string{
Eventf(corev1.EventTypeNormal, "ChannelReconciled", "Channel reconciled: %q", testKey),
},
}, {
Name: "Already reconciled",
Key: testKey,
Expand All @@ -154,9 +151,6 @@ func TestReconcile(t *testing.T) {
WithInMemoryChannelSubscribers(subscribers()),
WithInMemoryChannelAddress(backingChannelHostname)),
},
WantEvents: []string{
Eventf(corev1.EventTypeNormal, "ChannelReconciled", "Channel reconciled: %q", testKey),
},
}, {
Name: "Backing channel created",
Key: testKey,
Expand All @@ -171,9 +165,6 @@ func TestReconcile(t *testing.T) {
WantCreates: []runtime.Object{
createChannel(testNS, channelName, false),
},
WantEvents: []string{
Eventf(corev1.EventTypeNormal, "ChannelReconciled", "Channel reconciled: %q", testKey),
},
WantStatusUpdates: []clientgotesting.UpdateActionImpl{{
Object: NewChannel(channelName, testNS,
WithChannelTemplate(channelCRD()),
Expand Down Expand Up @@ -213,9 +204,6 @@ func TestReconcile(t *testing.T) {
// Updates
WithChannelObservedGeneration(42)),
}},
WantEvents: []string{
Eventf(corev1.EventTypeNormal, "ChannelReconciled", "Channel reconciled: %q", testKey),
},
}, {
Name: "Updating subscribers statuses",
Key: testKey,
Expand Down Expand Up @@ -246,9 +234,6 @@ func TestReconcile(t *testing.T) {
WithChannelAddress(backingChannelHostname),
WithChannelSubscriberStatuses(subscriberStatuses())),
}},
WantEvents: []string{
Eventf(corev1.EventTypeNormal, "ChannelReconciled", "Channel reconciled: %q", testKey),
},
}, {
Name: "Updating v1alpha1 channelable subscribers statuses",
Key: testKey,
Expand All @@ -274,9 +259,6 @@ func TestReconcile(t *testing.T) {
WithChannelAddress(backingChannelHostname),
WithChannelSubscriberStatuses(subscriberStatuses())),
}},
WantEvents: []string{
Eventf(corev1.EventTypeNormal, "ChannelReconciled", "Channel reconciled: %q", testKey),
},
}}

logger := logtesting.TestLogger(t)
Expand Down

0 comments on commit 27632fe

Please sign in to comment.