From b1484f2f24b26d787afca09d7ef21aadbe11b699 Mon Sep 17 00:00:00 2001 From: Alison Dowdney Date: Thu, 15 Apr 2021 22:52:15 +0100 Subject: [PATCH] Change createAlertCmdRun parsing to include namespace Signed-off-by: Alison Dowdney --- cmd/flux/create_alert.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/flux/create_alert.go b/cmd/flux/create_alert.go index 3988915e..dfab1301 100644 --- a/cmd/flux/create_alert.go +++ b/cmd/flux/create_alert.go @@ -74,14 +74,15 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error { eventSources := []notificationv1.CrossNamespaceObjectReference{} for _, eventSource := range alertArgs.eventSources { - kind, name := utils.ParseObjectKindName(eventSource) + kind, name, namespace := utils.ParseObjectKindNameNamespace(eventSource) if kind == "" { return fmt.Errorf("invalid event source '%s', must be in format /", eventSource) } eventSources = append(eventSources, notificationv1.CrossNamespaceObjectReference{ - Kind: kind, - Name: name, + Kind: kind, + Name: name, + Namespace: namespace, }) }