pod

package
v2.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPodSelected = errors.New("no pod is selected")

Functions

func CheckPodMeetSelector

func CheckPodMeetSelector(ctx context.Context, c client.Client, pod v1.Pod, selector v1alpha1.PodSelectorSpec, clusterScoped bool, targetNamespace string, enableFilterNamespace bool) (bool, error)

CheckPodMeetSelector checks if this pod meets the selection criteria.

func SelectAndFilterPods

func SelectAndFilterPods(ctx context.Context, c client.Client, r client.Reader, spec *v1alpha1.PodSelector, clusterScoped bool, targetNamespace string, enableFilterNamespace bool) ([]v1.Pod, error)

SelectAndFilterPods returns the list of pods that filtered by selector and SelectorMode Deprecated: use pod.SelectImpl as instead

func SelectPods

func SelectPods(ctx context.Context, c client.Client, r client.Reader, selector v1alpha1.PodSelectorSpec, clusterScoped bool, targetNamespace string, enableFilterNamespace bool) ([]v1.Pod, error)

SelectPods returns the list of pods that are available for pod chaos action. It returns all pods that match the configured label, annotation and namespace selectors. If pods are specifically specified by `selector.Pods`, it just returns the selector.Pods.

Types

type Params

type Params struct {
	fx.In

	Client client.Client
	Reader client.Reader `name:"no-cache"`
}

type Pod

type Pod struct {
	v1.Pod
}

func (*Pod) Id

func (pod *Pod) Id() string

type SelectImpl

type SelectImpl struct {
	generic.Option
	// contains filtered or unexported fields
}

func New

func New(params Params) *SelectImpl

func (*SelectImpl) Select

func (impl *SelectImpl) Select(ctx context.Context, ps *v1alpha1.PodSelector) ([]*Pod, error)

Jump to

Keyboard shortcuts

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