Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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) Test ¶
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.