kube

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteOptions

type DeleteOptions struct {
	LabelSelector   string
	ResourceTypes   []string
	Timeout         time.Duration
	WaitForDeletion bool
}

type Factory

type Factory interface {
	// KubernetesClientSet returns a new kubernetes clientset or error
	KubernetesClientSet() (kubernetes.Interface, error)

	// ToRESTConfig returns a rest Config object or error
	ToRESTConfig() (*restclient.Config, error)

	// Apply applies the provided manifests
	Apply(ctx context.Context, manifests []byte) error

	// Wait waits for all of the provided `Resources` to be ready by calling
	// the `WaitFunc` of each resource until all of them returns `true`
	Wait(context.Context, *WaitOptions) error
}

func AddFlags

func AddFlags(flags *pflag.FlagSet) Factory

type Resource

type Resource struct {
	Name      string
	Namespace string

	// WaitFunc will be called to check if the resources is ready. Should return (true, nil)
	// if the resources is ready, (false, nil) if the resource is not ready yet, or (false, err)
	// if some error occured (in that case the `Wait` will fail with that error).
	WaitFunc WaitFunc
}

type WaitFunc

type WaitFunc func(ctx context.Context, f Factory, ns, name string) (bool, error)

type WaitOptions

type WaitOptions struct {
	// Inverval the duration between each iteration of calling all of the resources' `WaitFunc`s.
	Interval time.Duration

	// Timeout the max time to wait for all of the resources to be ready. If not all of the
	// resourecs are ready at time this will cause `Wait` to return an error.
	Timeout time.Duration

	// Resources the list of resources to wait for.
	Resources []Resource
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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