Documentation
¶
Overview ¶
Package script is a module's enabled script as a scheduler rule. The script is veto-only: true has no opinion and cannot turn a module on; false is a Forbid. A script that cannot be evaluated keeps its last verdict, so a transient failure does not flip a running module; with no verdict yet it is a Forbid.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Descriptor ¶
type Descriptor struct {
Path string
Settings addonutils.Values
Values addonutils.Values
}
Descriptor is a module's enabled script with its inputs: Values with the global block, Settings the module's own settings. The rule replaces global.enabledModules in Values before the run.
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule is the enabled-script rule of one module.
func NewRule ¶
func NewRule(descriptor func() *Descriptor, enabledModules func() []string, inputs func() string, logger *log.Logger) *Rule
NewRule constructs the rule of the script descriptor returns (nil: none). enabledModules is what the script sees as global.enabledModules; inputs identifies the settings and values the script reads (nil: run on every decision); logger should name the module.
func (*Rule) Decide ¶
Decide runs the script, under context.Background: rule.Rule carries no context. It has no timeout, accepted: the script runs under the scheduler's mutex, so a hung script would block every scheduler call; the scripts are small and ship with deckhouse. The error is only logged: the status keeps showing the last verdict.