1
0
mirror of synced 2026-06-26 21:50:48 +00:00

Fix Receiver type

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
This commit is contained in:
Matheus Pimenta
2026-06-24 16:00:20 +01:00
parent 9f995dfec0
commit 9a68454996
+7 -5
View File
@@ -77,16 +77,18 @@ func createReceiverCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("secret ref is required") return fmt.Errorf("secret ref is required")
} }
resources := []notificationv1.CrossNamespaceObjectReference{} resources := []notificationv1.ReceiverResource{}
for _, resource := range receiverArgs.resources { for _, resource := range receiverArgs.resources {
kind, name := utils.ParseObjectKindName(resource) kind, name := utils.ParseObjectKindName(resource)
if kind == "" { if kind == "" {
return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", resource) return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", resource)
} }
resources = append(resources, notificationv1.CrossNamespaceObjectReference{ resources = append(resources, notificationv1.ReceiverResource{
Kind: kind, CrossNamespaceObjectReference: notificationv1.CrossNamespaceObjectReference{
Name: name, Kind: kind,
Name: name,
},
}) })
} }
@@ -113,7 +115,7 @@ func createReceiverCmdRun(cmd *cobra.Command, args []string) error {
Type: receiverArgs.receiverType.String(), Type: receiverArgs.receiverType.String(),
Events: receiverArgs.events, Events: receiverArgs.events,
Resources: resources, Resources: resources,
SecretRef: meta.LocalObjectReference{ SecretRef: &meta.LocalObjectReference{
Name: receiverArgs.secretRef, Name: receiverArgs.secretRef,
}, },
Suspend: false, Suspend: false,