Documentation ¶
Index ¶
- func CheckPodMeetSelector(pod v1.Pod, selector v1alpha1.SelectorSpec) (bool, error)
- func GetService(ctx context.Context, c client.Client, namespace, controllerNamespace string, ...) (*v1.Service, error)
- func IsAllowedNamespaces(ctx context.Context, c client.Client, namespace string) (bool, error)
- func RandomFixedIndexes(start, end, count uint) []uint
- func SelectAndFilterPods(ctx context.Context, c client.Client, r client.Reader, spec SelectSpec, ...) ([]v1.Pod, error)
- func SelectPods(ctx context.Context, c client.Client, r client.Reader, ...) ([]v1.Pod, error)
- type SelectSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPodMeetSelector ¶
CheckPodMeetSelector checks if this pod meets the selection criteria. TODO: support to check fieldsSelector
func GetService ¶
func GetService(ctx context.Context, c client.Client, namespace, controllerNamespace string, serviceName string) (*v1.Service, error)
GetService get k8s service by service name
func IsAllowedNamespaces ¶ added in v1.2.0
func RandomFixedIndexes ¶
RandomFixedIndexes returns the `count` random indexes between `start` and `end`. [start, end)
func SelectAndFilterPods ¶
func SelectAndFilterPods(ctx context.Context, c client.Client, r client.Reader, spec SelectSpec, clusterScoped bool, targetNamespace string, enableFilterNamespace bool) ([]v1.Pod, error)
SelectAndFilterPods returns the list of pods that filtered by selector and PodMode
func SelectPods ¶
func SelectPods(ctx context.Context, c client.Client, r client.Reader, selector v1alpha1.SelectorSpec, 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 SelectSpec ¶
type SelectSpec interface { GetSelector() v1alpha1.SelectorSpec GetMode() v1alpha1.PodMode GetValue() string }
Click to show internal directories.
Click to hide internal directories.