cmd

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "k8svent",
	Short: "Send kubernetes pod state changes to webhook",
	Long: `Watch for kubernetes pod state changes and post them to the configured
webhooks.

You can provide the --url parameter multiple times to send to multiple
webhooks.

  $ k8svent --url=http://one.com/webhook --url=http://two.com/webhook

Alternatively, you can supply a comma-delimited list of webhook URLs
in the K8SVENT_WEBHOOKS environment variable or provide them in the pod
annotations.

By default k8svent watches pods in all namespaces.  If the --namespace
or K8SVENT_NAMESPACE environment variable is provided, only pods in
that namespace are reported on.

By default k8svent does not sign the webhook payloads.  If the
--secret or K8SVENT_WEBHOOK_SECRET environment variable is provided,
webhook payloads are signed using HMAC/SHA-1.`,
	Run: func(cmd *cobra.Command, args []string) {
		if err := vent.Vent(webhookURLs, namespace, webhookSecret, logLevel); err != nil {
			fmt.Fprintf(os.Stderr, "k8svent: venting failed: %v\n", err)
			os.Exit(1)
		}
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL