common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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

func ParseInverseOp(inverseOp, defaultHookName string) (hookName, opName string)

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.

Jump to

Keyboard shortcuts

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