Documentation
¶
Index ¶
- func GatherActualState(client *ssh.Client, projectName string, environment string, ...) (map[string]*ActualService, error)
- func GetServiceInspectData(client *ssh.Client, serviceName string, isSwarm bool) (map[string]interface{}, error)
- type ActualService
- type ChangeType
- type ReconciliationPlan
- type ReconciliationSummary
- type ServiceChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GatherActualState ¶
func GatherActualState( client *ssh.Client, projectName string, environment string, stateMgr *localstate.Manager, ) (map[string]*ActualService, error)
GatherActualState collects information about currently running services Returns a map of serviceName -> ActualService
Types ¶
type ActualService ¶
type ActualService struct {
Name string
Image string
Replicas int
Containers []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