Documentation
¶
Overview ¶
Package errormatch provides types and functions for matching job failure signals: exit codes, termination messages, and Kubernetes conditions.
ExitCodeMatcher supports In/NotIn set membership against container exit codes. Exit code 0 never matches. RegexMatcher holds a pattern string that callers compile at construction time and pass to MatchPattern.
Condition constants (ConditionOOMKilled, ConditionEvicted, ConditionDeadlineExceeded) and the KnownConditions map are provided for config validation. Non-pod conditions (ConditionPreempted, ConditionLeaseReturned) are also defined here for use by the retry engine but are not included in KnownConditions.
Index ¶
Constants ¶
const ( ConditionOOMKilled = "OOMKilled" ConditionEvicted = "Evicted" ConditionDeadlineExceeded = "DeadlineExceeded" )
Condition constants derived from KubernetesReason. OOMKilled is a container-level condition (container.State.Terminated.Reason). Evicted and DeadlineExceeded are pod-level conditions (pod.Status.Reason).
const ( ConditionPreempted = "Preempted" ConditionLeaseReturned = "LeaseReturned" )
Condition constants for non-pod error types (used by the retry engine). These are not observable from Kubernetes pod status, so the executor categorizer cannot match them.
Variables ¶
var KnownConditions = map[string]bool{ ConditionOOMKilled: true, ConditionEvicted: true, ConditionDeadlineExceeded: true, }
KnownConditions is the set of condition strings accepted by the executor error categorizer. Only conditions that map to real Kubernetes reason strings are included.
Functions ¶
func MatchExitCode ¶
func MatchExitCode(matcher *ExitCodeMatcher, exitCode int32) bool
MatchExitCode returns true if the exit code matches the matcher. Exit code 0 never matches (successful containers are not failures).
Types ¶
type ExitCodeMatcher ¶
type ExitCodeMatcher struct {
Operator ExitCodeOperator `yaml:"operator"`
Values []int32 `yaml:"values"`
}
ExitCodeMatcher specifies an operator and a set of exit code values.
type ExitCodeOperator ¶
type ExitCodeOperator string
ExitCodeOperator is a set membership operator: In or NotIn.
const ( ExitCodeOperatorIn ExitCodeOperator = "In" ExitCodeOperatorNotIn ExitCodeOperator = "NotIn" )
type RegexMatcher ¶
type RegexMatcher struct {
Pattern string `yaml:"pattern"`
}
RegexMatcher specifies a regex pattern as a string.