Skip to content

Commit

Permalink
Fix function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
creydr committed Aug 29, 2024
1 parent 8351df5 commit b82fc72
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions control-plane/pkg/core/config/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func ContentModeFromString(mode string) contract.ContentMode {
}
}

// ContractEventPoliciesEventPolicies resolves a list of v1alpha1.EventPolicy into a list of contract.EventPolicy
func ContractEventPoliciesEventPolicies(applyingEventPolicies []*eventingv1alpha1.EventPolicy, namespace string, features feature.Flags) []*contract.EventPolicy {
// ContractEventPoliciesFromEventPolicies resolves a list of v1alpha1.EventPolicy into a list of contract.EventPolicy
func ContractEventPoliciesFromEventPolicies(applyingEventPolicies []*eventingv1alpha1.EventPolicy, namespace string, features feature.Flags) []*contract.EventPolicy {
if !features.IsOIDCAuthentication() {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions control-plane/pkg/core/config/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ func TestMergeEgressConfig(t *testing.T) {
}
}

func TestEventPoliciesFromAppliedEventPoliciesStatus(t *testing.T) {
func TestContractEventPoliciesEventPolicies(t *testing.T) {

tests := []struct {
name string
Expand Down Expand Up @@ -855,7 +855,7 @@ func TestEventPoliciesFromAppliedEventPoliciesStatus(t *testing.T) {
}
}

got := ContractEventPoliciesEventPolicies(applyingPolicies, tt.namespace, features)
got := ContractEventPoliciesFromEventPolicies(applyingPolicies, tt.namespace, features)
expectedJSON, err := protojson.Marshal(&contract.Ingress{
EventPolicies: tt.expected,
})
Expand Down
2 changes: 1 addition & 1 deletion control-plane/pkg/reconciler/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ func (r *Reconciler) reconcilerBrokerResource(ctx context.Context, topic string,
Topics: []string{topic},
Ingress: &contract.Ingress{
Path: receiver.PathFromObject(broker),
EventPolicies: coreconfig.ContractEventPoliciesEventPolicies(applyingEventPolicies, broker.Namespace, features),
EventPolicies: coreconfig.ContractEventPoliciesFromEventPolicies(applyingEventPolicies, broker.Namespace, features),
},
FeatureFlags: &contract.FeatureFlags{
EnableEventTypeAutocreate: features.IsEnabled(feature.EvenTypeAutoCreate),
Expand Down
2 changes: 1 addition & 1 deletion control-plane/pkg/reconciler/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ func (r *Reconciler) getChannelContractResource(ctx context.Context, topic strin
Ingress: &contract.Ingress{
Host: receiver.Host(channel.GetNamespace(), channel.GetName()),
Path: receiver.Path(channel.GetNamespace(), channel.GetName()),
EventPolicies: coreconfig.ContractEventPoliciesEventPolicies(applyingEventPolicies, channel.Namespace, features),
EventPolicies: coreconfig.ContractEventPoliciesFromEventPolicies(applyingEventPolicies, channel.Namespace, features),
},
FeatureFlags: &contract.FeatureFlags{
EnableEventTypeAutocreate: features.IsEnabled(feature.EvenTypeAutoCreate) && !ownedByBroker(channel),
Expand Down
2 changes: 1 addition & 1 deletion control-plane/pkg/reconciler/sink/kafka_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func (r *Reconciler) getSinkContractResource(ctx context.Context, kafkaSink *eve
Ingress: &contract.Ingress{
Path: receiver.PathFromObject(kafkaSink),
ContentMode: coreconfig.ContentModeFromString(*kafkaSink.Spec.ContentMode),
EventPolicies: coreconfig.ContractEventPoliciesEventPolicies(applyingEventPolicies, kafkaSink.Namespace, features),
EventPolicies: coreconfig.ContractEventPoliciesFromEventPolicies(applyingEventPolicies, kafkaSink.Namespace, features),
},
FeatureFlags: &contract.FeatureFlags{
EnableEventTypeAutocreate: features.IsEnabled(feature.EvenTypeAutoCreate),
Expand Down

0 comments on commit b82fc72

Please sign in to comment.