feat(deploy): add independent supervisor control plane
CI / test (push) Failing after 28s

This commit is contained in:
m
2026-08-29 12:33:44 +03:00
parent 734db5d779
commit 3a563a29ee
8 changed files with 404 additions and 13 deletions
+27 -3
View File
@@ -9,6 +9,14 @@ const (
ReleaseRolledBack ReleaseState = "ROLLED_BACK"
)
type TrafficMode string
const (
TrafficStable TrafficMode = "STABLE"
TrafficCanaryHeader TrafficMode = "CANARY_HEADER"
TrafficCandidate TrafficMode = "CANDIDATE"
)
type Release struct {
ID string
Version string
@@ -22,9 +30,12 @@ type Observation struct {
ObservedAtUnixMillis int64
}
type Lifeboat struct {
Current Release
LastKnownGood Release
Observations []Observation
Current Release
LastKnownGood Release
Observations []Observation
TrafficMode TrafficMode
StableUpstream string
CandidateUpstream string
}
func (l *Lifeboat) Start(candidate Release) bool {
@@ -60,3 +71,16 @@ func (l *Lifeboat) Rollback() bool {
l.Current.State = ReleaseRolledBack
return true
}
func (l *Lifeboat) SetTraffic(mode TrafficMode, stableUpstream, candidateUpstream string) bool {
if mode != TrafficStable && mode != TrafficCanaryHeader && mode != TrafficCandidate {
return false
}
if stableUpstream == "" || (mode != TrafficStable && candidateUpstream == "") {
return false
}
l.TrafficMode = mode
l.StableUpstream = stableUpstream
l.CandidateUpstream = candidateUpstream
return true
}