overrides

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateOverrides

func AnnotateOverrides(obj client.Object, overrides []Override) error

AnnotateOverrides will take care of appropriatly serializng your overrides to annotations merging them with others that exist

Types

type Override

type Override struct {
	Path      string `json:"path"`
	Value     any    `json:"value"`
	Condition string `json:"condition"`
}

mirror of type Op struct and type jsonOp struct in internal/resource/mutation/mutation.go trying to do type Override = intmut.Op will get you an erro about extending methods. could make it a composition but not going down that path yet

func AllowVPA

func AllowVPA(container string, req corev1.ResourceRequirements) ([]Override, error)

AllowVPA lets VPA or external actor raise resources/requests for a given container. It checks if the requests and limits are higher and also that the path is not managed by eno (so eno can lower if eno was the last updater)

func ReplaceIf

func ReplaceIf(condition string) (Override, error)

ReplaceIf uses overrides to create a conditonal eno.azure.io/replace that only applies when some condition is met useful if you want server side apply most of the time except for some corner cases

func (*Override) String

func (o *Override) String() string

String is for debugging only because escaped json cel is hard to read.

func (*Override) Test

func (o *Override) Test(data map[string]interface{}) (bool, error)

Test lets you unittest your overrides Condition agains some data kid of like unstructerd.unstructered. variables like pathManagedByEno can also be mocked at top level of data along with self. it does NOT actually test api server logic as it doesn't have fieldmanger two sets of data. Still it can be helpful in finding bugs in Conditions. See examples in unittest.

Jump to

Keyboard shortcuts

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