util

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBackoff = wait.Backoff{
	Steps:    4,
	Duration: 10 * time.Millisecond,
	Factor:   5.0,
	Jitter:   0.1,
}

DefaultBackoff is the recommended backoff for a conflict where a client may be attempting to make an unrelated modification to a resource under active management by one or more controllers.

View Source
var DefaultRetry = wait.Backoff{
	Steps:    5,
	Duration: 10 * time.Millisecond,
	Factor:   1.0,
	Jitter:   0.1,
}

DefaultRetry is the recommended retry for a conflict where multiple clients are making changes to the same resource.

Functions

func IsIPv4 added in v1.21.0

func IsIPv4(str string) bool

IsIPv4 checks whether IP address is IPv4

func RetryOnError

func RetryOnError(backoff wait.Backoff, retriable func(error) bool, fn func() error) error

RetryOnError allows the caller to retry fn in case the error returned by fn is retriable according to the provided function. backoff defines the maximum retries and the wait interval between two retries.

Types

type FakeRouteSetClientWrapper added in v1.21.0

type FakeRouteSetClientWrapper struct {

	// Set these functions if you want to override the default fakeClient behavior
	GetFunc    func(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RouteSet, err error)
	CreateFunc func(ctx context.Context, routeSet *v1alpha1.RouteSet, opts v1.CreateOptions) (result *v1alpha1.RouteSet, err error)
	DeleteFunc func(ctx context.Context, name string, opts v1.DeleteOptions) error
	ListFunc   func(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RouteSetList, err error)
	// contains filtered or unexported fields
}

FakeRouteSetClientWrapper allows functions to be replaced for fault injection

func NewFakeRouteSetClientWrapper added in v1.21.0

func NewFakeRouteSetClientWrapper(fakeClient *fake.Clientset) *FakeRouteSetClientWrapper

NewFakeRouteSetClientWrapper creates a FakeClientWrapper

func (*FakeRouteSetClientWrapper) Create added in v1.21.0

func (w *FakeRouteSetClientWrapper) Create(ctx context.Context, route *v1alpha1.RouteSet, options v1.CreateOptions) (result *v1alpha1.RouteSet, err error)

Create saves the object obj in the Kubernetes cluster.

func (*FakeRouteSetClientWrapper) Delete added in v1.21.0

func (w *FakeRouteSetClientWrapper) Delete(ctx context.Context, name string, options v1.DeleteOptions) error

Delete deletes the given obj from Kubernetes cluster.

func (*FakeRouteSetClientWrapper) Discovery added in v1.21.0

Discovery retrieves the DiscoveryClient

func (*FakeRouteSetClientWrapper) Get added in v1.21.0

func (w *FakeRouteSetClientWrapper) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RouteSet, err error)

Get retrieves an obj for the given object key from the Kubernetes Cluster.

func (*FakeRouteSetClientWrapper) List added in v1.21.0

func (w *FakeRouteSetClientWrapper) List(ctx context.Context, options v1.ListOptions) (result *v1alpha1.RouteSetList, err error)

List retrieves list of objects for a given namespace and list options.

func (*FakeRouteSetClientWrapper) NsxV1alpha1 added in v1.21.0

NsxV1alpha1 retrieves the NsxV1alpha1Client

Jump to

Keyboard shortcuts

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