kubernetesk8s.io/kubernetes/plugin/pkg/webhook Index | Files

package webhook

import "k8s.io/kubernetes/plugin/pkg/webhook"

Package webhook implements a generic HTTP webhook plugin.

Index

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 *restclient.RESTClient
	// contains filtered or unexported fields
}

func NewGenericWebhook

func NewGenericWebhook(kubeConfigFile string, groupVersions []unversioned.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() restclient.Result) restclient.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

webhook.go

Version
v1.5.4-beta.0
Published
Feb 15, 2017
Platform
js/wasm
Imports
12 packages
Last checked
17 minutes ago

Tools for package owners.