Documentation
¶
Index ¶
- func FilterHPAs(hpas []autoscalingv2.HorizontalPodAutoscaler) []autoscalingv2.HorizontalPodAutoscaler
- func FilterNone[T any](objs []T) []T
- func FilterPodDisruptionBudgets(pdbs []policyv1.PodDisruptionBudget) []policyv1.PodDisruptionBudget
- func ReduceClusterRoleBindings(ctx context.Context, k8sClient client.Client, ...) error
- func ReduceClusterRoles(ctx context.Context, k8sClient client.Client, ...) error
- 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 ReduceServiceAccounts(ctx context.Context, k8sClient client.Client, ...) 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
- func ReduceValidatingWebhookConfigurations(ctx context.Context, k8sClient client.Client, ...) 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
FiltenNone filter nothing, that is it returns the same slice as provided.
func FilterPodDisruptionBudgets ¶ added in v1.4.0
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 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 ReduceDataPlanes ¶ added in v1.2.2
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 ¶ added in v1.5.0
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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
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 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 ReduceServicesByName ¶ added in v1.5.0
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.
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([]autoscalingv2.HorizontalPodAutoscaler) []autoscalingv2.HorizontalPodAutoscaler
HPAFilterFunc filters a list of HorizontalPodAutoscalers and returns the ones that should be deleted.
type PDBFilterFunc ¶ added in v1.4.0
type PDBFilterFunc func([]policyv1.PodDisruptionBudget) []policyv1.PodDisruptionBudget
PDBFilterFunc filters a list of PodDisruptionBudgets and returns the ones that should be deleted.