Documentation
¶
Overview ¶
Package reconcile evaluates every obligation in a baton file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInventory = errors.New("inventory check failed")
ErrInventory marks a component missing from the project inventory.
var ErrOptions = errors.New("invalid reconcile options")
ErrOptions marks unusable reconcile options.
Functions ¶
func CheckInventory ¶
CheckInventory reports components missing from the Security Insights repository list. It reads the current file, not a past one.
func ClockStart ¶
ClockStart is when a step's grace starts: the latest time one of its prerequisites became done, or the trigger time when none can say. Waived and not-applicable prerequisites count from the trigger.
Types ¶
type Instance ¶
type Instance struct {
Rollout string `json:"rollout"`
Key string `json:"key"` // "<repo>:release:<tag>:<commit>"
Home string `json:"home"` // repo that gets the parent issue
Binding string `json:"binding"`
Commit string `json:"commit,omitempty"`
Complete bool `json:"complete"`
Results []Result `json:"obligations"`
}
Instance is one rollout triggered by one event.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler evaluates obligations.
func (*Reconciler) Run ¶
func (r *Reconciler) Run() (Report, error)
Run checks every rollout and invariant as of opts.AsOf.
type Report ¶
type Report struct {
AsOf time.Time `json:"as_of"`
Rules string `json:"rules,omitempty"` // digest of the rules file
Instances []Instance `json:"rollouts"`
Invariants []Result `json:"invariants"`
}
Report is everything one run found.
type Result ¶
type Result struct {
ID string `json:"id"` // "<rollout>/<id>" or invariant id
Type string `json:"type,omitempty"`
Target string `json:"target"`
Owners []string `json:"owners,omitempty"`
Binding string `json:"binding"`
Commit string `json:"commit,omitempty"` // trigger tag's commit
Action string `json:"action,omitempty"`
State State `json:"state"`
AgeDays *int `json:"age_days,omitempty"`
// DoneSince is when a done step became done, if its probes can tell.
DoneSince *time.Time `json:"done_since,omitempty"`
Evidence string `json:"evidence"`
}
Result is one evaluated obligation.