Fix Receiver type
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user