Documentation
¶
Overview ¶
Package promotion answers "is the fix in prod yet".
One row per app, one column per environment, sorted so the apps whose environments disagree float to the top. The matrix compares and never promotes: no control here mutates anything, because deploying belongs to the pipeline that owns it.
Two distinctions carry most of the value. Ahead is worse than behind: behind is a schedule, ahead is an out-of-band change. And absent is not forbidden: "it is not deployed there" and "I cannot see it" are different facts, and a matrix that renders them the same way is a matrix that lies during an incident.
Index ¶
Constants ¶
const ( StateSame = "same" StateBehind = "behind" StateAhead = "ahead" StateDiffers = "differs" StateDigestDiffers = "digest-differs" StateAbsent = "absent" StateDenied = "denied" // StateSplit is an environment whose clusters do not agree. It never // carries a version, because picking one would be the guess this state // exists to prevent. StateSplit = "split" )
Cell states.
Variables ¶
This section is empty.
Functions ¶
func CompareTags ¶ added in v1.2.0
CompareTags orders two version tags, returning zero when they cannot be ordered. Claiming a direction we cannot establish would be worse than saying they merely differ.
func Identity ¶ added in v1.2.0
Identity is how one app is recognized across environments.
Name plus namespace, with an environment suffix or prefix tolerated, because team-a-qa and team-a-prod are one team's namespace in two places and lining those up is the whole point of the view.
func Orderable ¶ added in v1.2.0
Orderable reports whether a tag can take part in an ordering at all.
CompareTags returns zero both for two tags that are equal and for a pair it refuses to order, so zero alone cannot tell those apart. A caller picking a maximum needs the difference: an unorderable tag that wins the maximum by never losing would become a yardstick nothing can be measured against.
func StripEnvToken ¶ added in v1.2.0
StripEnvToken removes the environment token from a namespace, so that team-a-qa and team-a-prod resolve to one identity.
Types ¶
type Cell ¶
type Cell struct {
Env string `json:"env"`
Namespace string `json:"namespace,omitempty"`
State string `json:"state"`
Tag string `json:"tag,omitempty"`
Image string `json:"image,omitempty"`
Digest string `json:"digest,omitempty"`
// DigestPending marks a cell whose digest has not arrived. Tag comparison
// never waits for it, and a missing digest never reads as a match.
DigestPending bool `json:"digestPending,omitempty"`
Health string `json:"health,omitempty"`
Ready string `json:"ready,omitempty"`
RevisionAt string `json:"revisionAt,omitempty"`
Note string `json:"note,omitempty"`
// Severe marks the states that deserve the error hue rather than a warning:
// ahead of upstream, and a tag that resolves to a different digest.
Severe bool `json:"severe,omitempty"`
// Clusters is how many contexts back this cell. Zero and one both mean a
// single cluster; the UI shows the count only above one.
Clusters int `json:"clusters,omitempty"`
}
Cell is one instance, compared against its upstream.
type Env ¶
type Env struct {
Name string `json:"name"`
Risk string `json:"risk"`
// Context is the first context bound to this environment, kept so a cell
// can still be opened. Contexts is all of them.
Context string `json:"context,omitempty"`
Contexts []string `json:"contexts,omitempty"`
// Unreadable names the contexts that did not answer. A cell in an
// environment with any unreadable context can never claim agreement,
// because the clusters nobody read might disagree.
Unreadable []string `json:"unreadable,omitempty"`
}
Env is one column.
type Instance ¶
type Instance struct {
Env string
Context string
App string
Namespace string
Present bool
// Denied marks an environment that could not be read. It is deliberately
// not the same as absent.
Denied bool
DeniedReason string
Image string
Tag string
Digest string
Health string
Ready string
RevisionAt string
}
Instance is one app as it exists in one environment.