diff --git a/cmd/gotk/create_alert.go b/cmd/gotk/create_alert.go index 4df61b87..ca0d8f56 100644 --- a/cmd/gotk/create_alert.go +++ b/cmd/gotk/create_alert.go @@ -84,7 +84,7 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error { } if len(eventSources) == 0 { - return fmt.Errorf("atleast one event source is required") + return fmt.Errorf("at least one event source is required") } sourceLabels, err := parseLabels() diff --git a/cmd/gotk/create_receiver.go b/cmd/gotk/create_receiver.go index 7488cbbc..9d8ddda4 100644 --- a/cmd/gotk/create_receiver.go +++ b/cmd/gotk/create_receiver.go @@ -19,7 +19,6 @@ package main import ( "context" "fmt" - "github.com/fluxcd/pkg/apis/meta" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" @@ -30,6 +29,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1" + "github.com/fluxcd/pkg/apis/meta" ) var createReceiverCmd = &cobra.Command{ @@ -146,6 +146,17 @@ func createReceiverCmdRun(cmd *cobra.Command, args []string) error { logger.Successf("receiver %s is ready", name) + namespacedName := types.NamespacedName{ + Namespace: namespace, + Name: name, + } + err = kubeClient.Get(ctx, namespacedName, &receiver) + if err != nil { + return fmt.Errorf("receiver sync failed: %w", err) + } + + logger.Successf("generated webhook URL %s", receiver.Status.URL) + return nil } diff --git a/cmd/gotk/export_alert.go b/cmd/gotk/export_alert.go index 98a7f042..9e5ea0c6 100644 --- a/cmd/gotk/export_alert.go +++ b/cmd/gotk/export_alert.go @@ -35,7 +35,7 @@ var exportAlertCmd = &cobra.Command{ Short: "Export Alert resources in YAML format", Long: "The export alert command exports one or all Alert resources in YAML format.", Example: ` # Export all Alert resources - gotk export alert --all > kustomizations.yaml + gotk export alert --all > alerts.yaml # Export a Alert gotk export alert main > main.yaml diff --git a/cmd/gotk/export_alertprovider.go b/cmd/gotk/export_alertprovider.go index d4ecd771..1d74d3a0 100644 --- a/cmd/gotk/export_alertprovider.go +++ b/cmd/gotk/export_alertprovider.go @@ -35,7 +35,7 @@ var exportAlertProviderCmd = &cobra.Command{ Short: "Export Provider resources in YAML format", Long: "The export alert-provider command exports one or all Provider resources in YAML format.", Example: ` # Export all Provider resources - gotk export ap --all > kustomizations.yaml + gotk export ap --all > alert-providers.yaml # Export a Provider gotk export ap slack > slack.yaml diff --git a/cmd/gotk/export_receiver.go b/cmd/gotk/export_receiver.go index cafbde69..108cdace 100644 --- a/cmd/gotk/export_receiver.go +++ b/cmd/gotk/export_receiver.go @@ -35,7 +35,7 @@ var exportReceiverCmd = &cobra.Command{ Short: "Export Receiver resources in YAML format", Long: "The export receiver command exports one or all Receiver resources in YAML format.", Example: ` # Export all Receiver resources - gotk export rcv --all > kustomizations.yaml + gotk export rcv --all > receivers.yaml # Export a Receiver gotk export rcv main > main.yaml diff --git a/cmd/gotk/get_alert.go b/cmd/gotk/get_alert.go index 0158bdc7..7b13aba7 100644 --- a/cmd/gotk/get_alert.go +++ b/cmd/gotk/get_alert.go @@ -31,12 +31,12 @@ import ( ) var getAlertCmd = &cobra.Command{ - Use: "alert", + Use: "alerts", Aliases: []string{}, Short: "Get Alert statuses", Long: "The get alert command prints the statuses of the resources.", Example: ` # List all Alerts and their status - gotk get alert + gotk get alerts `, RunE: getAlertCmdRun, } diff --git a/cmd/gotk/get_alertprovider.go b/cmd/gotk/get_alertprovider.go index 65ca975b..6617c86c 100644 --- a/cmd/gotk/get_alertprovider.go +++ b/cmd/gotk/get_alertprovider.go @@ -29,12 +29,12 @@ import ( ) var getAlertProviderCmd = &cobra.Command{ - Use: "alert-provider", + Use: "alert-providers", Aliases: []string{"ap"}, Short: "Get Provider statuses", Long: "The get alert-provider command prints the statuses of the resources.", Example: ` # List all Providers and their status - gotk get alert-provider + gotk get alert-providers `, RunE: getAlertProviderCmdRun, } diff --git a/cmd/gotk/get_receiver.go b/cmd/gotk/get_receiver.go index a01a7d82..9a635cc1 100644 --- a/cmd/gotk/get_receiver.go +++ b/cmd/gotk/get_receiver.go @@ -31,12 +31,12 @@ import ( ) var getReceiverCmd = &cobra.Command{ - Use: "receiver", + Use: "receivers", Aliases: []string{"rcv"}, Short: "Get Receiver statuses", Long: "The get receiver command prints the statuses of the resources.", Example: ` # List all Receiver and their status - gotk get receiver + gotk get receivers `, RunE: getReceiverCmdRun, }