Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Wildcard indicates that any value can be matched.
Wildcard = "*"
)
Variables ¶
View Source
var AllResourceInterpreterCustomizationRules = []Rule{
&retentionRule{},
&replicaResourceRule{},
&replicaRevisionRule{},
&statusReflectionRule{},
&statusAggregationRule{},
&healthInterpretationRule{},
&dependencyInterpretationRule{},
}
AllResourceInterpreterCustomizationRules all InterpreterOperations
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct { ObjGVK schema.GroupVersionKind Operation configv1alpha1.InterpreterOperation Rule configv1alpha1.RuleWithOperations }
Matcher determines if the Object matches the Rule.
type NameValue ¶ added in v1.4.0
type NameValue struct { Name string Value interface{} }
NameValue name and value.
type Rule ¶ added in v1.4.0
type Rule interface { // Name returns the name of the rule. Name() string // Document explains detail of rule. Document() string // GetScript returns the script for the rule from customization. If not enabled, return empty GetScript(*configv1alpha1.ResourceInterpreterCustomization) string // SetScript set the script for the rule. If script is empty, disable the rule. SetScript(*configv1alpha1.ResourceInterpreterCustomization, string) // Run execute the rule with given args, and return the result. Run(*configurableinterpreter.ConfigurableInterpreter, RuleArgs) *RuleResult }
Rule known how to get and set script for interpretation rule, and can execute the rule with given args.
type RuleArgs ¶ added in v1.4.0
type RuleArgs struct { Desired *unstructured.Unstructured Observed *unstructured.Unstructured Status []workv1alpha2.AggregatedStatusItem Replica int64 }
RuleArgs rule execution args.
type RuleResult ¶ added in v1.4.0
RuleResult rule execution result.
type Rules ¶ added in v1.4.0
type Rules []Rule
Rules is a series of rules.
func (Rules) GetByOperation ¶ added in v1.4.0
GetByOperation returns the matched rule by operation name, ignoring case. Return nil if none is matched.
Click to show internal directories.
Click to hide internal directories.