reconcile

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ActiveLabel = "tako.active"
View Source
const ConfigHashLabel = "tako.configHash"
View Source
const DeployStrategyLabel = "tako.deployStrategy"
View Source
const RevisionLabel = "tako.revision"
View Source
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 GatherActualStateByServer(
	sshPool *ssh.Pool,
	cfg *config.Config,
	environment string,
	serverNames []string,
) (map[string]map[string]*ActualService, error)

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

type ReconciliationSummary struct {
	Total   int
	Adds    int
	Updates int
	Removes int
	NoOps   int
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL