Skip to content

Commit

Permalink
Fix backend switching
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobebway committed Aug 29, 2024
1 parent 67a5abc commit a66a6ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
klabels "k8s.io/apimachinery/pkg/labels"
ktypes "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/tools/record"
"k8s.io/utils/ptr"
kctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
Expand Down Expand Up @@ -753,7 +754,8 @@ func (r *Reconciler) emitConditionEvent(subscription *eventingv1alpha2.Subscript

// SetupUnmanaged creates a controller under the client control.
func (r *Reconciler) SetupUnmanaged(ctx context.Context, mgr kctrl.Manager) error {
ctru, err := controller.NewUnmanaged(reconcilerName, mgr, controller.Options{Reconciler: r})
opts := controller.Options{Reconciler: r, SkipNameValidation: ptr.To(true)}
ctru, err := controller.NewUnmanaged(reconcilerName, mgr, opts)
if err != nil {
return fmt.Errorf("failed to create unmanaged controller: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package jetstream
import (
"context"
"errors"
"k8s.io/utils/ptr"
"reflect"
"time"

Expand Down Expand Up @@ -68,7 +69,8 @@ func NewReconciler(client client.Client, jsBackend jetstream.Backend,

// SetupUnmanaged creates a controller under the client control.
func (r *Reconciler) SetupUnmanaged(ctx context.Context, mgr kctrl.Manager) error {
ctru, err := controller.NewUnmanaged(reconcilerName, mgr, controller.Options{Reconciler: r})
opts := controller.Options{Reconciler: r, SkipNameValidation: ptr.To(true)}
ctru, err := controller.NewUnmanaged(reconcilerName, mgr, opts)
if err != nil {
r.namedLogger().Errorw("Failed to create unmanaged controller", "error", err)
return err
Expand Down

0 comments on commit a66a6ff

Please sign in to comment.