Fix minor issues

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

@ -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
}

@ -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

@ -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

@ -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

@ -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,
}

@ -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,
}

@ -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,
}

Loading…
Cancel
Save