Documentation
¶
Index ¶
- func FilterHPAs(hpas []autoscalingv2.HorizontalPodAutoscaler) []autoscalingv2.HorizontalPodAutoscaler
- func FilterNone[T any](objs []T) []T
- func FilterPodDisruptionBudgets(pdbs []policyv1.PodDisruptionBudget) []policyv1.PodDisruptionBudget
- func ReduceDataPlanes(ctx context.Context, k8sClient client.Client, ...) error
- func ReduceDeployments(ctx context.Context, k8sClient client.Client, deployments []appsv1.Deployment, ...) error
- func ReduceHPAs(ctx context.Context, k8sClient client.Client, ...) error
- func ReduceKongCredentials[T constraints.SupportedCredentialType, TPtr constraints.KongCredential[T]](ctx context.Context, k8sClient client.Client, kongCredentials []T) error
- func ReduceKongPluginBindings(ctx context.Context, k8sClient client.Client, ...) error
- func ReduceNetworkPolicies(ctx context.Context, k8sClient client.Client, ...) error
- func ReducePodDisruptionBudgets(ctx context.Context, k8sClient client.Client, ...) error
- func ReduceSecrets(ctx context.Context, k8sClient client.Client, secrets []corev1.Secret, ...) error
- func ReduceServices(ctx context.Context, k8sClient client.Client, services []corev1.Service, ...) error
- func ReduceServicesByName(ctx context.Context, k8sClient client.Client, services []corev1.Service, ...) error
- type HPAFilterFunc
- type PDBFilterFunc
- type PreDeleteHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterHPAs ¶
func FilterHPAs(hpas []autoscalingv2.HorizontalPodAutoscaler) []autoscalingv2.HorizontalPodAutoscaler
FilterHPAs filters out the HorizontalPodAutoscalers to be kept and returns all the HorizontalPodAutoscalers to be deleted. The filtered-out HorizontalPodAutoscalers is decided as follows: 1. creationTimestamp (older is better)
func FilterNone ¶
func FilterNone[T any](objs []T) []T
FilterNone filter nothing, that is it returns the same slice as provided.
func FilterPodDisruptionBudgets ¶
func FilterPodDisruptionBudgets(pdbs []policyv1.PodDisruptionBudget) []policyv1.PodDisruptionBudget
FilterPodDisruptionBudgets filters out the PodDisruptionBudgets to be kept and returns all the PodDisruptionBudgets to be deleted. The filtered-out PodDisruptionBudget is decided as follows: 1. creationTimestamp (older is better)
func ReduceDataPlanes ¶
func ReduceDataPlanes(ctx context.Context, k8sClient client.Client, dataplanes []operatorv1beta1.DataPlane) error
ReduceDataPlanes detects the best DataPlane in the set and deletes all the others.
func ReduceDeployments ¶
func ReduceDeployments(ctx context.Context, k8sClient client.Client, deployments []appsv1.Deployment, preDeleteHooks ...PreDeleteHook) error
ReduceDeployments detects the best Deployment in the set and deletes all the others. It accepts optional preDeleteHooks which are executed before every Deployment delete operation.
func ReduceHPAs ¶
func ReduceHPAs(ctx context.Context, k8sClient client.Client, hpas []autoscalingv2.HorizontalPodAutoscaler, filter HPAFilterFunc) error
ReduceHPAs detects the best HorizontalPodAutoscaler in the set and deletes all the others.
func ReduceKongCredentials ¶
func ReduceKongCredentials[ T constraints.SupportedCredentialType, TPtr constraints.KongCredential[T], ](ctx context.Context, k8sClient client.Client, kongCredentials []T) error
ReduceKongCredentials detects the best KongCredential in the set and deletes all the others.
func ReduceKongPluginBindings ¶
func ReduceKongPluginBindings(ctx context.Context, k8sClient client.Client, kpbs []configurationv1alpha1.KongPluginBinding) error
ReduceKongPluginBindings detects the best KongPluginBinding in the set and deletes all the others.
func ReduceNetworkPolicies ¶
func ReduceNetworkPolicies(ctx context.Context, k8sClient client.Client, networkPolicies []networkingv1.NetworkPolicy) error
ReduceNetworkPolicies detects the best NetworkPolicy in the set and deletes all the others.
func ReducePodDisruptionBudgets ¶
func ReducePodDisruptionBudgets(ctx context.Context, k8sClient client.Client, pdbs []policyv1.PodDisruptionBudget, filter PDBFilterFunc) error
ReducePodDisruptionBudgets detects the best PodDisruptionBudget in the set and deletes all the others.
func ReduceSecrets ¶
func ReduceSecrets(ctx context.Context, k8sClient client.Client, secrets []corev1.Secret, preDeleteHooks ...PreDeleteHook) error
ReduceSecrets detects the best secret in the set and deletes all the others. It accepts optional preDeleteHooks which are executed before every Secret delete operation.
func ReduceServices ¶
func ReduceServices(ctx context.Context, k8sClient client.Client, services []corev1.Service, preDeleteHooks ...PreDeleteHook) error
ReduceServices detects the best Service in the set and deletes all the others. It accepts optional preDeleteHooks which are executed before every Service delete operation.
func ReduceServicesByName ¶
func ReduceServicesByName(ctx context.Context, k8sClient client.Client, services []corev1.Service, name string, preDeleteHooks ...PreDeleteHook) error
ReduceServicesByName deletes all service in the list except the one with specified name (if exists). It accepts optional preDeleteHooks which are executed before every Service delete operation.
Types ¶
type HPAFilterFunc ¶
type HPAFilterFunc func([]autoscalingv2.HorizontalPodAutoscaler) []autoscalingv2.HorizontalPodAutoscaler
HPAFilterFunc filters a list of HorizontalPodAutoscalers and returns the ones that should be deleted.
type PDBFilterFunc ¶
type PDBFilterFunc func([]policyv1.PodDisruptionBudget) []policyv1.PodDisruptionBudget
PDBFilterFunc filters a list of PodDisruptionBudgets and returns the ones that should be deleted.