rule

package
v2.4.3-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 27 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteRule

func ExecuteRule(
	rule *stork_api.Rule,
	rType Type,
	owner runtime.Object,
	podNamespace string,
) (chan bool, error)

ExecuteRule executes rules for the given owner. PVCs are used to figure out the pods on which the rule actions will be run on

func Init

func Init() error

Init initializes the rule executor

func PerformRuleRecovery

func PerformRuleRecovery(
	owner runtime.Object,
) error

PerformRuleRecovery terminates potential background commands running pods for the given owner

func ValidateRule

func ValidateRule(rule *stork_api.Rule, ruleType Type) error

ValidateRule validates a rule

Types

type CommandTask

type CommandTask struct {
	TaskID string `json:"taskID"`
	Pods   []Pod  `json:"pods"`
}

CommandTask tracks pods where commands for a taskID might still be running

type Pod

type Pod struct {
	UID       string `json:"uid"`
	Namespace string `json:"namespace"`
}

Pod is a simple type to encapsulate a Pod's uid and namespace

type Type

type Type string

Type The type of rule to be executed

const (
	// PreExecRule This type of rule is to be run before an operation
	PreExecRule Type = "preExecRule"
	// PostExecRule This type of rule is to be run after an operation
	PostExecRule Type = "postExecRule"
)

Jump to

Keyboard shortcuts

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