Documentation

Overview

    Package webhook implements a generic HTTP webhook plugin.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func WithExponentialBackoff

    func WithExponentialBackoff(initialBackoff time.Duration, webhookFn func() error) error

      WithExponentialBackoff will retry webhookFn() up to 5 times with exponentially increasing backoff when it returns an error for which apierrors.SuggestsClientDelay() or apierrors.IsInternalError() returns true.

      Types

      type GenericWebhook

      type GenericWebhook struct {
      	RestClient *rest.RESTClient
      	// contains filtered or unexported fields
      }

      func NewGenericWebhook

      func NewGenericWebhook(registry *registered.APIRegistrationManager, codecFactory serializer.CodecFactory, kubeConfigFile string, groupVersions []schema.GroupVersion, initialBackoff time.Duration) (*GenericWebhook, error)

        NewGenericWebhook creates a new GenericWebhook from the provided kubeconfig file.

        func (*GenericWebhook) WithExponentialBackoff

        func (g *GenericWebhook) WithExponentialBackoff(webhookFn func() rest.Result) rest.Result

          WithExponentialBackoff will retry webhookFn() up to 5 times with exponentially increasing backoff when it returns an error for which apierrors.SuggestsClientDelay() or apierrors.IsInternalError() returns true.

          Source Files