Documentation
¶
Overview ¶
Package operations provides functions for the mutating webhook.
Package operations provides json patch operations.
Index ¶
- func PolicyFromEnv() state.MutationPolicy
- func ShouldMutate(resourceLabels, nsLabels map[string]string, mode state.MutationPolicy) bool
- type AdmitFunc
- type Hook
- type PatchOperation
- func AddPatchOperation(path string, value interface{}) PatchOperation
- func CopyPatchOperation(from, path string) PatchOperation
- func MovePatchOperation(from, path string) PatchOperation
- func RemovePatchOperation(path string) PatchOperation
- func ReplacePatchOperation(path string, value interface{}) PatchOperation
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PolicyFromEnv ¶ added in v0.78.0
func PolicyFromEnv() state.MutationPolicy
PolicyFromEnv reads ZARF_AGENT_MUTATION_POLICY from the environment
func ShouldMutate ¶ added in v0.78.0
func ShouldMutate(resourceLabels, nsLabels map[string]string, mode state.MutationPolicy) bool
ShouldMutate reports whether the agent should mutate a resource, prioritizing resource labels
Types ¶
type PatchOperation ¶
type PatchOperation struct {
Op string `json:"op"`
Path string `json:"path"`
From string `json:"from,omitempty"`
Value interface{} `json:"value,omitempty"`
}
PatchOperation is an operation of a JSON patch https://tools.ietf.org/html/rfc6902.
func AddPatchOperation ¶
func AddPatchOperation(path string, value interface{}) PatchOperation
AddPatchOperation returns an add JSON patch operation.
func CopyPatchOperation ¶
func CopyPatchOperation(from, path string) PatchOperation
CopyPatchOperation returns a copy JSON patch operation.
func MovePatchOperation ¶
func MovePatchOperation(from, path string) PatchOperation
MovePatchOperation returns a move JSON patch operation.
func RemovePatchOperation ¶
func RemovePatchOperation(path string) PatchOperation
RemovePatchOperation returns a remove JSON patch operation.
func ReplacePatchOperation ¶
func ReplacePatchOperation(path string, value interface{}) PatchOperation
ReplacePatchOperation returns a replace JSON patch operation.
type Result ¶
type Result struct {
Allowed bool
Msg string
PatchOps []PatchOperation
}
Result contains the result of an admission request.