lua

package
v2.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigMapKey added in v2.1.0

func GetConfigMapKey(gvk schema.GroupVersionKind) string

func OpenSafeOs

func OpenSafeOs(L *lua.LState) int

func SafeOsLoader

func SafeOsLoader(L *lua.LState) int

Types

type ResourceHealthOverrides

type ResourceHealthOverrides map[string]appv1.ResourceOverride

func (ResourceHealthOverrides) GetResourceHealth

func (overrides ResourceHealthOverrides) GetResourceHealth(obj *unstructured.Unstructured) (*health.HealthStatus, error)

type VM

type VM struct {
	ResourceOverrides map[string]appv1.ResourceOverride
	// UseOpenLibs flag to enable open libraries. Libraries are disabled by default while running, but enabled during testing to allow the use of print statements
	UseOpenLibs bool
}

VM Defines a struct that implements the luaVM

func (VM) ExecuteHealthLua

func (vm VM) ExecuteHealthLua(obj *unstructured.Unstructured, script string) (*health.HealthStatus, error)

ExecuteHealthLua runs the lua script to generate the health status of a resource

func (VM) ExecuteResourceAction

func (vm VM) ExecuteResourceAction(obj *unstructured.Unstructured, script string) (*unstructured.Unstructured, error)

func (VM) ExecuteResourceActionDiscovery

func (vm VM) ExecuteResourceActionDiscovery(obj *unstructured.Unstructured, script string) ([]appv1.ResourceAction, error)

func (VM) GetHealthScript

func (vm VM) GetHealthScript(obj *unstructured.Unstructured) (string, bool, error)

GetHealthScript attempts to read lua script from config and then filesystem for that resource

func (VM) GetResourceAction

func (vm VM) GetResourceAction(obj *unstructured.Unstructured, actionName string) (appv1.ResourceActionDefinition, error)

GetResourceAction attempts to read lua script from config and then filesystem for that resource

func (VM) GetResourceActionDiscovery

func (vm VM) GetResourceActionDiscovery(obj *unstructured.Unstructured) (string, error)

Jump to

Keyboard shortcuts

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