Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reconciled normal event from channel #3694

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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