patch

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

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.

Jump to

Keyboard shortcuts

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