Documentation ¶
Index ¶
- Constants
- func AssertEqPatch(t *testing.T, got, want resource_admission.PatchRecord)
- func AssertPatchOneOf(t *testing.T, got resource_admission.PatchRecord, ...)
- func EqPatch(a, b resource_admission.PatchRecord) bool
- func GetAddAnnotationPatch(annotationName, annotationValue string) resource_admission.PatchRecord
- func GetAddEmptyAnnotationsPatch() resource_admission.PatchRecord
- type Calculator
Constants ¶
View Source
const ( // ResourceUpdatesAnnotation is the name of annotation // containing resource updates performed by VPA. ResourceUpdatesAnnotation = "vpaUpdates" )
Variables ¶
This section is empty.
Functions ¶
func AssertEqPatch ¶
func AssertEqPatch(t *testing.T, got, want resource_admission.PatchRecord)
AssertEqPatch asserts patches are equal.
func AssertPatchOneOf ¶
func AssertPatchOneOf(t *testing.T, got resource_admission.PatchRecord, want []resource_admission.PatchRecord)
AssertPatchOneOf asserts patch is one of possible expected patches.
func EqPatch ¶
func EqPatch(a, b resource_admission.PatchRecord) bool
EqPatch returns true if patches are equal by comparing their marshalling result.
func GetAddAnnotationPatch ¶
func GetAddAnnotationPatch(annotationName, annotationValue string) resource_admission.PatchRecord
GetAddAnnotationPatch returns a patch for an annotation.
func GetAddEmptyAnnotationsPatch ¶
func GetAddEmptyAnnotationsPatch() resource_admission.PatchRecord
GetAddEmptyAnnotationsPatch returns a patch initializing empty annotations.
Types ¶
type Calculator ¶
type Calculator interface {
CalculatePatches(pod *core.Pod, vpa *vpa_types.VerticalPodAutoscaler) ([]resource.PatchRecord, error)
}
Calculator is capable of calculating required patches for pod.
func NewObservedContainersCalculator ¶
func NewObservedContainersCalculator() Calculator
NewObservedContainersCalculator returns calculator for observed containers patches.
func NewResourceUpdatesCalculator ¶
func NewResourceUpdatesCalculator(recommendationProvider recommendation.Provider) Calculator
NewResourceUpdatesCalculator returns a calculator for resource update patches.
Click to show internal directories.
Click to hide internal directories.