1
0
mirror of synced 2026-06-26 13:40: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")
}
resources := []notificationv1.CrossNamespaceObjectReference{}
resources := []notificationv1.ReceiverResource{}
for _, resource := range receiverArgs.resources {
kind, name := utils.ParseObjectKindName(resource)
if kind == "" {
return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", resource)
}
resources = append(resources, notificationv1.CrossNamespaceObjectReference{
Kind: kind,
Name: name,
resources = append(resources, notificationv1.ReceiverResource{
CrossNamespaceObjectReference: notificationv1.CrossNamespaceObjectReference{
Kind: kind,
Name: name,
},
})
}
@@ -113,7 +115,7 @@ func createReceiverCmdRun(cmd *cobra.Command, args []string) error {
Type: receiverArgs.receiverType.String(),
Events: receiverArgs.events,
Resources: resources,
SecretRef: meta.LocalObjectReference{
SecretRef: &meta.LocalObjectReference{
Name: receiverArgs.secretRef,
},
Suspend: false,