Documentation
¶
Index ¶
- Constants
- func AggregateActualStateByServer(actualByServer map[string]map[string]*ActualService) map[string]*ActualService
- func GatherActualStateByServer(sshPool *ssh.Pool, cfg *config.Config, environment string, ...) (map[string]map[string]*ActualService, error)
- func GatherActualStateFromServers(sshPool *ssh.Pool, cfg *config.Config, environment string, ...) (map[string]*ActualService, error)
- func SafeServiceConfigHash(service config.ServiceConfig) (string, bool)
- type ActualService
- type ChangeType
- type ReconciliationPlan
- type ReconciliationSummary
- type ServiceChange
Constants ¶
const ActiveLabel = "tako.active"
const ConfigHashLabel = "tako.configHash"
const DeployStrategyLabel = "tako.deployStrategy"
const RevisionLabel = "tako.revision"
const SlotLabel = "tako.slot"
Variables ¶
This section is empty.
Functions ¶
func AggregateActualStateByServer ¶ added in v0.3.0
func AggregateActualStateByServer(actualByServer map[string]map[string]*ActualService) map[string]*ActualService
func GatherActualStateByServer ¶ added in v0.3.0
func GatherActualStateFromServers ¶ added in v0.3.0
func GatherActualStateFromServers( sshPool *ssh.Pool, cfg *config.Config, environment string, serverNames []string, _ *localstate.Manager, ) (map[string]*ActualService, error)
GatherActualStateFromServers collects takod container state from every requested node and aggregates replicas by service.
func SafeServiceConfigHash ¶ added in v0.3.0
func SafeServiceConfigHash(service config.ServiceConfig) (string, bool)
Types ¶
type ActualService ¶
type ActualService struct {
Name string
Image string
RevisionImages map[string]string
Replicas int
Containers []string
ConfigHash string
RuntimeID string
Persistent bool
CurrentRevision string
PreviousRevision string
WarmingRevisions []string
DeployStrategy string
ActiveContainers []string
WarmingContainers []string
ConfigSnapshot *config.ServiceConfig // Last deployed config
}
ActualService represents a currently running service
type ChangeType ¶
type ChangeType string
ChangeType represents the type of change needed
const ( ChangeAdd ChangeType = "add" // New service in config ChangeUpdate ChangeType = "update" // Service exists but changed ChangeRemove ChangeType = "remove" // Service removed from config ChangeNone ChangeType = "none" // No changes needed )
type ReconciliationPlan ¶
type ReconciliationPlan struct {
ProjectName string
Environment string
Changes []ServiceChange
Summary ReconciliationSummary
}
ReconciliationPlan represents the full plan of changes
func ComputePlan ¶
func ComputePlan( projectName string, environment string, desiredServices map[string]config.ServiceConfig, actualServices map[string]*ActualService, ) *ReconciliationPlan
ComputePlan compares desired state (config) with actual state (running services) and generates a reconciliation plan
func (*ReconciliationPlan) FormatPlan ¶
func (p *ReconciliationPlan) FormatPlan() string
FormatPlan returns a human-readable formatted plan
func (*ReconciliationPlan) FormatPlanVerbose ¶ added in v0.0.3
func (p *ReconciliationPlan) FormatPlanVerbose(showUnchanged bool) string
FormatPlanVerbose returns a detailed formatted plan with optional unchanged services
func (*ReconciliationPlan) HasDestructiveChanges ¶
func (p *ReconciliationPlan) HasDestructiveChanges() bool
HasDestructiveChanges returns true if plan includes removals
func (*ReconciliationPlan) IsEmpty ¶
func (p *ReconciliationPlan) IsEmpty() bool
IsEmpty returns true if no changes needed
func (*ReconciliationPlan) NeedsConfirmation ¶
func (p *ReconciliationPlan) NeedsConfirmation() bool
NeedsConfirmation returns true if user should confirm before proceeding
type ReconciliationSummary ¶
ReconciliationSummary provides counts of changes
type ServiceChange ¶
type ServiceChange struct {
Type ChangeType
ServiceName string
OldConfig *config.ServiceConfig // nil for adds
NewConfig *config.ServiceConfig // nil for removes
Reasons []string // Why this change is needed
}
ServiceChange represents a change to be made to a service