Documentation
¶
Overview ¶
Package deploywhy turns the stored facts of one deploy into a short verdict.
Index ¶
Constants ¶
const ( VerdictOOMKilled = "oom_killed" VerdictExitNonZero = "exit_nonzero" VerdictHealthFailed = "health_failing" VerdictNewLogs = "new_log_patterns" VerdictNoSignal = "no_signal" VerdictOK = "ok" )
Verdict names the strongest signal found, in priority order.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Changes ¶
type Changes struct {
Image *Change `json:"image,omitempty"`
Port *Change `json:"port,omitempty"`
EnvAdded []string `json:"env_added,omitempty"`
EnvRemoved []string `json:"env_removed,omitempty"`
EnvChanged []string `json:"env_changed,omitempty"`
}
Changes is what differs from the last good deploy. Env holds key names only, never values.
type Health ¶
type Health struct {
Target string `json:"target"`
Success bool `json:"success"`
StatusCode int `json:"status_code,omitempty"`
Error string `json:"error,omitempty"`
}
Health is the last probe result recorded for the deploy.
type Input ¶
type Input struct {
DeployID string
Failed bool
ExitCode *int
OOMKilled bool
Health *Health
Templates []Template
BaselineID string
BaselineTemplate []Template
Cause *Cause
TailLines []string
TailMax int
Changes Changes
}
Input is everything Compute needs, all read from stored records.
type Report ¶
type Report struct {
DeployID string `json:"deploy_id"`
Verdict string `json:"verdict"`
ExitCode *int `json:"exit_code,omitempty"`
OOMKilled bool `json:"oom_killed,omitempty"`
Health *Health `json:"health,omitempty"`
BaselineID string `json:"baseline_deploy_id,omitempty"`
NewTemplateCount int `json:"new_template_count"`
NewTemplates []Template `json:"new_templates"`
Cause *Cause `json:"cause,omitempty"`
Tail []TailLine `json:"tail,omitempty"`
Changes Changes `json:"changes"`
Summary []string `json:"summary"`
}
Report is the verdict and its evidence.
type TailLine ¶
TailLine is one log line with the number of consecutive repeats folded into it.
func CollapseTail ¶
CollapseTail folds consecutive repeats of lines (already secret-masked) and keeps the last n entries.