Documentation ¶
Index ¶
- func FilterHPAs(hpas []autoscalingv2.HorizontalPodAutoscaler) []autoscalingv2.HorizontalPodAutoscaler
- func FilterNone[T any](objs []T) []T
- func ReduceClusterRoleBindings(ctx context.Context, k8sClient client.Client, ...) error
- func ReduceClusterRoles(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 ReduceNetworkPolicies(ctx context.Context, k8sClient client.Client, ...) error
- func ReduceSecrets(ctx context.Context, k8sClient client.Client, secrets []corev1.Secret, ...) error
- func ReduceServiceAccounts(ctx context.Context, k8sClient client.Client, ...) error
- func ReduceServices(ctx context.Context, k8sClient client.Client, services []corev1.Service, ...) error
- func ReduceValidatingWebhookConfigurations(ctx context.Context, k8sClient client.Client, ...) error
- type HPAFilterFunc
- 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
FiltenNone filter nothing, that is it returns the same slice as provided.
func ReduceClusterRoleBindings ¶
func ReduceClusterRoleBindings(ctx context.Context, k8sClient client.Client, clusterRoleBindings []rbacv1.ClusterRoleBinding) error
ReduceClusterRoleBindings detects the best ClusterRoleBinding in the set and deletes all the others.
func ReduceClusterRoles ¶
func ReduceClusterRoles(ctx context.Context, k8sClient client.Client, clusterRoles []rbacv1.ClusterRole) error
ReduceClusterRoles detects the best ClusterRole 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 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 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 ReduceServiceAccounts ¶
func ReduceServiceAccounts(ctx context.Context, k8sClient client.Client, serviceAccounts []corev1.ServiceAccount) error
ReduceServiceAccounts detects the best serviceAccount in the set and deletes all the others.
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 ReduceValidatingWebhookConfigurations ¶
func ReduceValidatingWebhookConfigurations(ctx context.Context, k8sClient client.Client, webhookConfigurations []admregv1.ValidatingWebhookConfiguration) error
ReduceValidatingWebhookConfigurations detects the best ValidatingWebhookConfiguration in the set and deletes all the others.
Types ¶
type HPAFilterFunc ¶
type HPAFilterFunc func(hpas []autoscalingv2.HorizontalPodAutoscaler) []autoscalingv2.HorizontalPodAutoscaler
HPAFilterFunc filters a list of HorizontalPodAutoscalers.