Fix minor issues

pull/302/head
Philip Laine 4 years ago
parent 94cf7c329c
commit 65b8942416

@ -84,7 +84,7 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
} }
if len(eventSources) == 0 { 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() sourceLabels, err := parseLabels()

@ -19,7 +19,6 @@ package main
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/fluxcd/pkg/apis/meta"
"github.com/spf13/cobra" "github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
@ -30,6 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1" notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
"github.com/fluxcd/pkg/apis/meta"
) )
var createReceiverCmd = &cobra.Command{ var createReceiverCmd = &cobra.Command{
@ -146,6 +146,17 @@ func createReceiverCmdRun(cmd *cobra.Command, args []string) error {
logger.Successf("receiver %s is ready", name) 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 return nil
} }

@ -35,7 +35,7 @@ var exportAlertCmd = &cobra.Command{
Short: "Export Alert resources in YAML format", Short: "Export Alert resources in YAML format",
Long: "The export alert command exports one or all Alert resources in YAML format.", Long: "The export alert command exports one or all Alert resources in YAML format.",
Example: ` # Export all Alert resources Example: ` # Export all Alert resources
gotk export alert --all > kustomizations.yaml gotk export alert --all > alerts.yaml
# Export a Alert # Export a Alert
gotk export alert main > main.yaml gotk export alert main > main.yaml

@ -35,7 +35,7 @@ var exportAlertProviderCmd = &cobra.Command{
Short: "Export Provider resources in YAML format", Short: "Export Provider resources in YAML format",
Long: "The export alert-provider command exports one or all 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 Example: ` # Export all Provider resources
gotk export ap --all > kustomizations.yaml gotk export ap --all > alert-providers.yaml
# Export a Provider # Export a Provider
gotk export ap slack > slack.yaml gotk export ap slack > slack.yaml

@ -35,7 +35,7 @@ var exportReceiverCmd = &cobra.Command{
Short: "Export Receiver resources in YAML format", Short: "Export Receiver resources in YAML format",
Long: "The export receiver command exports one or all Receiver resources in YAML format.", Long: "The export receiver command exports one or all Receiver resources in YAML format.",
Example: ` # Export all Receiver resources Example: ` # Export all Receiver resources
gotk export rcv --all > kustomizations.yaml gotk export rcv --all > receivers.yaml
# Export a Receiver # Export a Receiver
gotk export rcv main > main.yaml gotk export rcv main > main.yaml

@ -31,12 +31,12 @@ import (
) )
var getAlertCmd = &cobra.Command{ var getAlertCmd = &cobra.Command{
Use: "alert", Use: "alerts",
Aliases: []string{}, Aliases: []string{},
Short: "Get Alert statuses", Short: "Get Alert statuses",
Long: "The get alert command prints the statuses of the resources.", Long: "The get alert command prints the statuses of the resources.",
Example: ` # List all Alerts and their status Example: ` # List all Alerts and their status
gotk get alert gotk get alerts
`, `,
RunE: getAlertCmdRun, RunE: getAlertCmdRun,
} }

@ -29,12 +29,12 @@ import (
) )
var getAlertProviderCmd = &cobra.Command{ var getAlertProviderCmd = &cobra.Command{
Use: "alert-provider", Use: "alert-providers",
Aliases: []string{"ap"}, Aliases: []string{"ap"},
Short: "Get Provider statuses", Short: "Get Provider statuses",
Long: "The get alert-provider command prints the statuses of the resources.", Long: "The get alert-provider command prints the statuses of the resources.",
Example: ` # List all Providers and their status Example: ` # List all Providers and their status
gotk get alert-provider gotk get alert-providers
`, `,
RunE: getAlertProviderCmdRun, RunE: getAlertProviderCmdRun,
} }

@ -31,12 +31,12 @@ import (
) )
var getReceiverCmd = &cobra.Command{ var getReceiverCmd = &cobra.Command{
Use: "receiver", Use: "receivers",
Aliases: []string{"rcv"}, Aliases: []string{"rcv"},
Short: "Get Receiver statuses", Short: "Get Receiver statuses",
Long: "The get receiver command prints the statuses of the resources.", Long: "The get receiver command prints the statuses of the resources.",
Example: ` # List all Receiver and their status Example: ` # List all Receiver and their status
gotk get receiver gotk get receivers
`, `,
RunE: getReceiverCmdRun, RunE: getReceiverCmdRun,
} }

Loading…
Cancel
Save