Documentation
¶
Index ¶
- Constants
- func ConvertGVRToGVK(mapper meta.RESTMapper, gvr schema.GroupVersionResource) (*schema.GroupVersionKind, error)
- func GetCheckHookSpec(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
- func GetExecHookSpec(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
- func GetHookSpecForInverseOp(hooks []*Recipe.Hook, inverseOp, defaultHookName string) *kubeobjects.HookSpec
- func GetHookSpecFromRecipe(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
- func GetHookTimeout(hook *kubeobjects.HookSpec) int
- func GetJobHookSpec(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
- func GetRestMapper() (meta.RESTMapper, error)
- func GetScaleHookSpec(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
- func ParseInverseOp(inverseOp, defaultHookName string) (hookName, opName string)
- func PrepareMapForDefinedTypes() map[string]schema.GroupVersionKind
- func ShouldFailOnError(hook *kubeobjects.HookSpec) bool
- func ShouldInverseOpBeExecuted(inverseOp string, hookSpec *kubeobjects.HookSpec, err error) bool
Constants ¶
const DefaultTimeoutValue = 300
Variables ¶
This section is empty.
Functions ¶
func ConvertGVRToGVK ¶
func ConvertGVRToGVK(mapper meta.RESTMapper, gvr schema.GroupVersionResource) (*schema.GroupVersionKind, error)
ConvertGVRToGVK converts GroupVersionResource to GroupVersionKind
func GetCheckHookSpec ¶
func GetCheckHookSpec(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
GetCheckHookSpec creates a HookSpec for a check type hook
func GetExecHookSpec ¶
func GetExecHookSpec(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
GetExecHookSpec creates a HookSpec for an exec type hook
func GetHookSpecForInverseOp ¶
func GetHookSpecForInverseOp(hooks []*Recipe.Hook, inverseOp, defaultHookName string) *kubeobjects.HookSpec
GetHookSpecForInverseOp retrieves the hook specification for an inverse operation. It searches through the recipe hooks and returns the appropriate HookSpec.
func GetHookSpecFromRecipe ¶
func GetHookSpecFromRecipe(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
GetHookSpecFromRecipe creates a HookSpec from a Recipe hook and operation name.
func GetHookTimeout ¶
func GetHookTimeout(hook *kubeobjects.HookSpec) int
GetHookTimeout returns the timeout value for any hook type. Priority: operation-specific timeout > hook-level timeout > default (300s)
func GetJobHookSpec ¶
func GetJobHookSpec(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
GetJobHookSpec creates a HookSpec for a job type hook
func GetRestMapper ¶
func GetRestMapper() (meta.RESTMapper, error)
GetRestMapper creates a REST mapper for API discovery
func GetScaleHookSpec ¶
func GetScaleHookSpec(hook *Recipe.Hook, opName string) *kubeobjects.HookSpec
GetScaleHookSpec creates a HookSpec for a scale type hook
func ParseInverseOp ¶
ParseInverseOp parses the inverse operation string into hookName and opName. Supported formats:
- "hookName/opName" - uses the specified hookName and opName
- "/opName" - uses defaultHookName with the specified opName
- "opName" - uses defaultHookName with the specified opName
func PrepareMapForDefinedTypes ¶
func PrepareMapForDefinedTypes() map[string]schema.GroupVersionKind
PrepareMapForDefinedTypes creates a GVK map for common resource types
func ShouldFailOnError ¶
func ShouldFailOnError(hook *kubeobjects.HookSpec) bool
ShouldFailOnError determines if a hook should fail on error. Priority: operation-specific onError > hook-level onError > default ("fail") Returns true if should fail, false if should continue
func ShouldInverseOpBeExecuted ¶
func ShouldInverseOpBeExecuted(inverseOp string, hookSpec *kubeobjects.HookSpec, err error) bool
Types ¶
This section is empty.