Skip to content

Commit

Permalink
fix: consumer provisions feature flags
Browse files Browse the repository at this point in the history
Signed-off-by: Calum Murray <cmurray@redhat.com>
  • Loading branch information
Cali0707 committed Aug 20, 2024
1 parent 2263a6b commit e07ee21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions control-plane/pkg/reconciler/consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"knative.dev/eventing/pkg/apis/feature"
"strings"

"go.uber.org/zap"
Expand Down Expand Up @@ -137,6 +138,9 @@ func (r *Reconciler) reconcileContractResource(ctx context.Context, c *kafkainte
Auth: nil, // Auth will be added by reconcileAuth
CloudEventOverrides: reconcileCEOverrides(c),
Reference: userFacingResourceRef,
FeatureFlags: &contract.FeatureFlags{
EnableEventTypeAutocreate: feature.FromContext(ctx).IsEnabled(feature.EvenTypeAutoCreate),
},
}

if err := r.reconcileAuth(ctx, c, resource); err != nil {
Expand Down
5 changes: 5 additions & 0 deletions control-plane/pkg/reconciler/consumer/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func TestReconcileKind(t *testing.T) {
Namespace: ConsumerNamespace,
Name: SourceName,
},
FeatureFlags: FeatureFlagsETAutocreate(false),
},
},
},
Expand Down Expand Up @@ -234,6 +235,7 @@ func TestReconcileKind(t *testing.T) {
Namespace: ConsumerNamespace,
Name: SourceName,
},
FeatureFlags: FeatureFlagsETAutocreate(false),
},
},
},
Expand Down Expand Up @@ -336,6 +338,7 @@ func TestReconcileKind(t *testing.T) {
Namespace: ConsumerNamespace,
Name: SourceName,
},
FeatureFlags: FeatureFlagsETAutocreate(false),
},
},
},
Expand Down Expand Up @@ -451,6 +454,7 @@ func TestReconcileKind(t *testing.T) {
Namespace: ConsumerNamespace,
Name: SourceName,
},
FeatureFlags: FeatureFlagsETAutocreate(false),
},
},
},
Expand Down Expand Up @@ -867,6 +871,7 @@ func TestReconcileKind(t *testing.T) {
Namespace: ConsumerNamespace,
Name: SourceName,
},
FeatureFlags: FeatureFlagsETAutocreate(false),
},
},
},
Expand Down

0 comments on commit e07ee21

Please sign in to comment.