util

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	VPARecConditionReasonUpdated = "Updated"
	VPARecConditionReasonIllegal = "Illegal"
)
View Source
const (
	VPAConditionReasonUpdated           = "Updated"
	VPAConditionReasonCalculatedIllegal = "Illegal"
	VPAConditionReasonPodSpecUpdated    = "PodSpecUpdated"
	VPAConditionReasonPodSpecNoUpdate   = "PodSpecNoUpdate"
)

Variables

This section is empty.

Functions

func DeleteOwnerReferencesForVPA

func DeleteOwnerReferencesForVPA(vpa *apis.KatalystVerticalPodAutoscaler, workload runtime.Object) error

DeleteOwnerReferencesForVPA is used to parse from workload list, and clean up the runtime information from OwnerReference fields for vpa CR

func GetVPARecResourceStatus

func GetVPARecResourceStatus(vpaPodResources []apis.PodResources, vpaContainerResources []apis.ContainerResources) (
	[]apis.RecommendedPodResources, []apis.RecommendedContainerResources, error)

GetVPARecResourceStatus updates resource recommendation results from vpa status to vpaRec status

func GetVPAResourceStatusWithCurrent

func GetVPAResourceStatusWithCurrent(vpa *apis.KatalystVerticalPodAutoscaler, pods []*core.Pod) ([]apis.PodResources, []apis.ContainerResources, error)

GetVPAResourceStatusWithCurrent updates pod current resource results from vpaRec to vpa

func GetVPAResourceStatusWithRecommendation

func GetVPAResourceStatusWithRecommendation(vpa *apis.KatalystVerticalPodAutoscaler, recPodResources []apis.RecommendedPodResources,
	recContainerResources []apis.RecommendedContainerResources) ([]apis.PodResources, []apis.ContainerResources, error)

GetVPAResourceStatusWithRecommendation updates resource recommendation results from vpaRec to vpa

func PatchVPAConditions

func PatchVPAConditions(
	ctx context.Context,
	vpaUpdater control.VPAUpdater,
	vpa *apis.KatalystVerticalPodAutoscaler,
	conditionType apis.VerticalPodAutoscalerConditionType,
	conditionStatus core.ConditionStatus,
	reason,
	message string,
) error

PatchVPAConditions is used to update conditions for vpa to APIServer

func PatchVPARecConditions

func PatchVPARecConditions(
	ctx context.Context,
	vpaRecUpdater control.VPARecommendationUpdater,
	vpaRec *apis.VerticalPodAutoscalerRecommendation,
	conditionType apis.VerticalPodAutoscalerRecommendationConditionType,
	conditionStatus core.ConditionStatus,
	reason,
	message string,
) error

PatchVPARecConditions is used to update conditions for vpaRec to APIServer

func SetOwnerReferencesForVPA

func SetOwnerReferencesForVPA(vpa *apis.KatalystVerticalPodAutoscaler, workload runtime.Object) error

SetOwnerReferencesForVPA is used to parse from workload list, and set the runtime information into OwnerReference fields for vpa CR

func SetVPAConditions

func SetVPAConditions(
	vpa *apis.KatalystVerticalPodAutoscaler,
	conditionType apis.VerticalPodAutoscalerConditionType,
	conditionStatus core.ConditionStatus,
	reason, message string) error

SetVPAConditions is used to set conditions for vpa in local vpa

func SetVPARecConditions

func SetVPARecConditions(
	vpaRec *apis.VerticalPodAutoscalerRecommendation,
	conditionType apis.VerticalPodAutoscalerRecommendationConditionType,
	conditionStatus core.ConditionStatus,
	reason, message string) error

SetVPARecConditions is used to set conditions for vpaRec in local vpa

func UpdateVPAConditions added in v0.2.0

func UpdateVPAConditions(
	ctx context.Context,
	vpaUpdater control.VPAUpdater,
	vpa *apis.KatalystVerticalPodAutoscaler,
	conditionType apis.VerticalPodAutoscalerConditionType,
	conditionStatus core.ConditionStatus,
	reason,
	message string,
) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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