Skip to content
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
2 changes: 0 additions & 2 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
"github.com/knative/eventing/pkg/reconciler/v1alpha1/broker"
"github.com/knative/pkg/configmap"
kncontroller "github.com/knative/pkg/controller"
"github.com/knative/pkg/logging/logkey"
"github.com/knative/pkg/signals"
"go.uber.org/zap"
controllerruntime "sigs.k8s.io/controller-runtime/pkg/client/config"
Expand All @@ -57,7 +56,6 @@ func main() {

logger, atomicLevel := setupLogger()
defer logger.Sync()
logger = logger.With(zap.String(logkey.ControllerType, logconfig.Controller))

// set up signals so we handle the first shutdown signal gracefully
stopCh := signals.SetupSignalHandler()
Expand Down
8 changes: 4 additions & 4 deletions pkg/reconciler/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
original, err := r.channelLister.Channels(namespace).Get(name)
if apierrs.IsNotFound(err) {
// The resource may no longer exist, in which case we stop processing.
logging.FromContext(ctx).Error("channel key in work queue no longer exists", zap.Any("key", key))
logging.FromContext(ctx).Error("Channel key in work queue no longer exists")
return nil
} else if err != nil {
return err
Expand All @@ -104,14 +104,14 @@ func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
// updates regardless of whether the reconcile error out.
err = r.reconcile(ctx, channel)
if err != nil {
logging.FromContext(ctx).Warn("Error reconciling Channel", zap.Error(err))
logging.FromContext(ctx).Error("Error reconciling Channel", zap.Error(err))
} else {
logging.FromContext(ctx).Debug("Successfully reconciled Channel", zap.Any("key", key))
logging.FromContext(ctx).Debug("Successfully reconciled Channel")
r.Recorder.Eventf(channel, corev1.EventTypeNormal, channelReconciled, "Channel reconciled: %s", key)
}

if _, updateStatusErr := r.updateStatus(ctx, channel.DeepCopy()); updateStatusErr != nil {
logging.FromContext(ctx).Warn("Error updating Channel status", zap.Any("key", key), zap.Error(updateStatusErr))
logging.FromContext(ctx).Warn("Error updating Channel status", zap.Error(updateStatusErr))
Comment thread
Harwayne marked this conversation as resolved.
r.Recorder.Eventf(channel, corev1.EventTypeWarning, channelUpdateStatusFailed, "Failed to update channel status: %s", key)
return updateStatusErr
}
Expand Down
1 change: 0 additions & 1 deletion pkg/reconciler/eventtype/eventtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
r.Logger.Errorf("invalid resource key: %s", key)
return nil
}
ctx = logging.WithLogger(ctx, r.Logger.Desugar().With(zap.String("key", key)))

// Get the EventType resource with this namespace/name
original, err := r.eventTypeLister.EventTypes(namespace).Get(name)
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/namespace/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
original, err := r.namespaceLister.Get(name)
if apierrs.IsNotFound(err) {
// The resource may no longer exist, in which case we stop processing.
logging.FromContext(ctx).Error("namespace key in work queue no longer exists", zap.Any("key", key))
logging.FromContext(ctx).Error("namespace key in work queue no longer exists")
return nil
} else if err != nil {
return err
Expand All @@ -149,9 +149,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
// whether the reconcile error out.
err = r.reconcile(ctx, ns)
if err != nil {
logging.FromContext(ctx).Error("Error reconciling Namespace", zap.Error(err), zap.Any("key", key))
logging.FromContext(ctx).Error("Error reconciling Namespace", zap.Error(err))
} else {
logging.FromContext(ctx).Debug("Namespace reconciled", zap.Any("key", key))
logging.FromContext(ctx).Debug("Namespace reconciled")
}

// Requeue if the resource is not ready:
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/subscription/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
original, err := r.subscriptionLister.Subscriptions(namespace).Get(name)
if apierrs.IsNotFound(err) {
// The resource may no longer exist, in which case we stop processing.
logging.FromContext(ctx).Error("subscription key in work queue no longer exists", zap.Any("key", key))
logging.FromContext(ctx).Error("subscription key in work queue no longer exists")
return nil
} else if err != nil {
return err
Expand Down
2 changes: 0 additions & 2 deletions pkg/reconciler/trigger/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ func NewController(
// converge the two. It then updates the Status block of the Trigger resource
// with the current status of the resource.
func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
ctx = logging.WithLogger(ctx, r.Logger.Desugar().With(zap.String("key", key)))

// Convert the namespace/name string into a distinct namespace and name.
namespace, name, err := cache.SplitMetaNamespaceKey(key)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion pkg/reconciler/v1alpha1/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
r.Logger.Errorf("invalid resource key: %s", key)
return nil
}
ctx = logging.WithLogger(ctx, r.Logger.Desugar().With(zap.String("key", key)))

// Get the Broker resource with this namespace/name
original, err := r.brokerLister.Brokers(namespace).Get(name)
Expand Down