Documentation
¶
Overview ¶
Package stack implements torque stack: filesystem discovery, hierarchical merge, selection, DAG planning, and orchestration that reuses the existing deploy engine.
Index ¶
- Constants
- func ApplyInputBundleToPlan(p *Plan, bundleRoot string, manifest *InputBundleManifest) error
- func ComputeExecutionOrder(p *Plan, command string) ([]string, error)
- func ComputeRunPlanHash(p *RunPlan) (string, error)
- func DriftReport(p *Plan) ([]string, error)
- func ExportRunBundle(ctx context.Context, root string, runID string, outPath string) (string, error)
- func ExtractBundleToTempDir(bundlePath string) (string, error)
- func GitChangedFiles(root string, gitRange string) ([]string, error)
- func InferDependencies(ctx context.Context, p *Plan, defaultKubeconfig string, ...) error
- func LoadMostRecentRun(root string) (string, error)
- func LoadRunNodeSteps(root string, runID string) (map[string]map[int]map[string]NodeStepCheckpoint, error)
- func PrintGraphDOT(w io.Writer, p *Plan) error
- func PrintGraphMermaid(w io.Writer, p *Plan) error
- func PrintPlanTable(w io.Writer, p *Plan) error
- func PrintRunAuditHTML(w io.Writer, a *RunAudit) error
- func PrintRunAuditTable(w io.Writer, a *RunAudit) error
- func PrintRunStatusTable(w io.Writer, runID string, s *RunSummary) error
- func PrintRunsTable(w io.Writer, runs []RunIndexEntry) error
- func RecomputeExecutionGroups(p *Plan) error
- func Run(ctx context.Context, opts RunOptions, out io.Writer, errOut io.Writer) error
- func RunStatus(ctx context.Context, opts StatusOptions, out io.Writer) error
- func ValidateHooksConfig(cfg StackHooksConfig, allowRunOnce bool, where string) error
- func ValidateRunnerResolved(r RunnerResolved) error
- func VerifyBundleIntegrity(bundlePath string) error
- func VerifyRunEventChain(events []RunEvent) error
- func WriteStackPlanBundle(outPath string, planJSON []byte, attestationJSON []byte, inputsPath string, ...) (string, error)
- type APIVersionKind
- type ActionPluginSpec
- type ActionSpec
- type AdaptiveConcurrency
- type AdaptiveConcurrencyOptions
- type ApplyCacheDecision
- type ApplyCacheEntry
- type ApplyCacheKey
- type ApplyOptions
- type BackfillSpec
- type BudgetWaitFields
- type BundleKey
- type BundleMissingNodeError
- type BundleSignature
- type ClusterTarget
- type CompileOptions
- type ConcurrencyFields
- type DatabaseSpec
- type DeleteOptions
- type EffectiveActionInput
- type EffectiveApplyInput
- type EffectiveBackfillInput
- type EffectiveChartInput
- type EffectiveDatabaseInput
- type EffectiveDeleteInput
- type EffectiveHostInput
- type EffectiveInput
- type EffectiveInputHashOptions
- type EffectiveKubernetesInput
- type EffectiveVerifyInput
- type FailureCluster
- type FileDigest
- type GitIdentity
- type Graph
- type HTTPHookConfig
- type HookSpec
- type HostCommandSpec
- type InferDepsOptions
- type InferredNeed
- type InferredReason
- type InputBundleManifest
- type InputBundleNode
- type InputBundleValue
- type KubectlHookConfig
- type KubernetesAppProbe
- type KubernetesCertSpec
- type KubernetesCertTarget
- type KubernetesCertTargetsFromSpec
- type KubernetesClusterSpec
- type KubernetesLifecyclePolicyOverrideScopeSpec
- type KubernetesLifecyclePolicyOverrideSpec
- type KubernetesLifecyclePolicySpec
- type KubernetesMaintenanceWindowSpec
- type KubernetesSpec
- type LoadSealedPlanOptions
- type LoadedRun
- type NodeDiffSummary
- type NodeExecutor
- type NodeMetaFields
- type NodeSpec
- type NodeStepCheckpoint
- type PhaseFields
- type Plan
- func Compile(u *Universe, opts CompileOptions) (*Plan, error)
- func FilterByClusters(p *Plan, clusters []string) *Plan
- func FilterByNodeStatus(p *Plan, statusByID map[string]string, wantStatuses []string) *Plan
- func LoadSealedPlan(ctx context.Context, opts LoadSealedPlanOptions) (*Plan, func(), error)
- func PlanFromRunPlan(rp *RunPlan) (*Plan, error)
- func Select(u *Universe, p *Plan, clusters []string, sel Selector) (*Plan, error)
- type ReleaseDefaults
- type ReleaseFile
- type ReleaseSpec
- type ResolvedRelease
- type RetryScheduledFields
- type RunArtifact
- type RunAudit
- type RunAuditOptions
- type RunBundleManifest
- type RunConsole
- type RunConsoleOptions
- type RunError
- type RunEvent
- type RunEventObserver
- type RunEventObserverFunc
- type RunEventType
- type RunIndexEntry
- type RunIntegrity
- type RunNodeSummary
- type RunOptions
- type RunPlan
- type RunSelector
- type RunSummary
- type RunTotals
- type RunnerAdaptive
- type RunnerAdaptiveResolved
- type RunnerConfig
- type RunnerLimits
- type RunnerLimitsResolved
- type RunnerResolved
- type ScriptHookConfig
- type SealedPlanError
- type SealedPlanErrorKind
- type SelectResult
- type Selector
- type StackApplyCLIConfig
- type StackCLIConfig
- type StackCLIResolved
- type StackDeleteCLIConfig
- type StackDiffSummary
- type StackFile
- type StackHooksConfig
- type StackLock
- type StackLockCLIConfig
- type StackPlanBundleManifest
- type StackProfile
- type StackResumeCLIConfig
- type StackSelectorConfig
- type StatusOptions
- type Universe
- type VerifyCacheEntry
- type VerifyCacheKey
- type VerifyConditionRequirement
- type VerifyOptions
Constants ¶
const ( NodeKindHelm = "release.helm" NodeKindAction = "action.script" NodeKindActionPlugin = "action.plugin" NodeKindDBRestorePoint = "db.restore-point" NodeKindDBSchemaExpand = "db.schema-expand" NodeKindDBBackfill = "db.backfill" NodeKindDBVerify = "db.verify" NodeKindDBCutover = "db.cutover" NodeKindDBSchemaContract = "db.schema-contract" NodeKindHostCommandRun = "host.command.run" NodeKindK8sClusterInspect = "k8s.cluster.inspect" NodeKindK8sCertInspect = "k8s.cert.inspect" NodeKindK8sCertRenew = "k8s.cert.renew" NodeKindK8sClusterVerify = "k8s.cluster.verify" )
Variables ¶
This section is empty.
Functions ¶
func ApplyInputBundleToPlan ¶
func ApplyInputBundleToPlan(p *Plan, bundleRoot string, manifest *InputBundleManifest) error
func ComputeExecutionOrder ¶
ComputeExecutionOrder returns a deterministic topological order for the plan. It uses the same ready-set priority as the runtime scheduler.
func ComputeRunPlanHash ¶
ComputeRunPlanHash returns a stable sha256 hash of the run plan content. The hash is computed over the JSON form with PlanHash itself cleared.
func DriftReport ¶
func ExportRunBundle ¶
func ExtractBundleToTempDir ¶
func InferDependencies ¶
func InferDependencies(ctx context.Context, p *Plan, defaultKubeconfig string, defaultKubeContext string, opts InferDepsOptions) error
InferDependencies renders each release client-side and infers additional Needs edges between releases in the same cluster. The inference is deterministic for identical inputs (chart+values+set+helm version) because it runs with UseCluster=false.
func LoadMostRecentRun ¶
func LoadRunNodeSteps ¶
func LoadRunNodeSteps(root string, runID string) (map[string]map[int]map[string]NodeStepCheckpoint, error)
LoadRunNodeSteps loads per-node step checkpoints for a run from the sqlite state store.
func PrintRunStatusTable ¶
func PrintRunStatusTable(w io.Writer, runID string, s *RunSummary) error
func PrintRunsTable ¶
func PrintRunsTable(w io.Writer, runs []RunIndexEntry) error
func RecomputeExecutionGroups ¶
RecomputeExecutionGroups recalculates execution groups after mutating dependencies.
func ValidateHooksConfig ¶
func ValidateHooksConfig(cfg StackHooksConfig, allowRunOnce bool, where string) error
func ValidateRunnerResolved ¶
func ValidateRunnerResolved(r RunnerResolved) error
func VerifyBundleIntegrity ¶
VerifyBundleIntegrity checks the hashes in manifest.json (if present) without requiring a signature.
func VerifyRunEventChain ¶
VerifyRunEventChain checks the per-event digest/crc chain produced by computeRunEventIntegrity. If the chain is absent (digest/crc empty on the first event), it returns nil for backward compatibility.
Types ¶
type APIVersionKind ¶
type ActionPluginSpec ¶ added in v1.0.9
type ActionPluginSpec struct {
Command []string `yaml:"command,omitempty" json:"command,omitempty"`
Env map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
WorkDir string `yaml:"workDir,omitempty" json:"workDir,omitempty"`
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Phases []string `yaml:"phases,omitempty" json:"phases,omitempty"`
Config map[string]any `yaml:"config,omitempty" json:"config,omitempty"`
}
type ActionSpec ¶ added in v1.0.9
type ActionSpec struct {
Idempotent bool `yaml:"idempotent,omitempty" json:"idempotent,omitempty"`
Apply *ScriptHookConfig `yaml:"apply,omitempty" json:"apply,omitempty"`
Delete *ScriptHookConfig `yaml:"delete,omitempty" json:"delete,omitempty"`
Plugin *ActionPluginSpec `yaml:"plugin,omitempty" json:"plugin,omitempty"`
}
type AdaptiveConcurrency ¶
type AdaptiveConcurrency struct {
Target int
Max int
Min int
// contains filtered or unexported fields
}
func NewAdaptiveConcurrency ¶
func NewAdaptiveConcurrency(max int) *AdaptiveConcurrency
func NewAdaptiveConcurrencyWithOptions ¶
func NewAdaptiveConcurrencyWithOptions(max int, opts AdaptiveConcurrencyOptions) *AdaptiveConcurrency
func (*AdaptiveConcurrency) OnFailure ¶
func (a *AdaptiveConcurrency) OnFailure(class string) (changed bool, reason string)
func (*AdaptiveConcurrency) OnSuccess ¶
func (a *AdaptiveConcurrency) OnSuccess() (changed bool, reason string)
func (*AdaptiveConcurrency) SnapshotString ¶
func (a *AdaptiveConcurrency) SnapshotString() string
type AdaptiveConcurrencyOptions ¶
type AdaptiveConcurrencyOptions struct {
Min int
// WindowSize controls how many recent outcomes influence shrink/ramp.
WindowSize int
// RampAfterSuccesses controls how many clean successes are required before
// increasing concurrency by 1.
RampAfterSuccesses int
// RampMaxFailureRate blocks ramp-up when the recent failure rate exceeds this.
RampMaxFailureRate float64
// CooldownSuccessesByClass controls how many subsequent successes must pass
// (without ramping) after a failure of a given class.
CooldownSuccessesByClass map[string]int
}
type ApplyCacheDecision ¶
type ApplyCacheDecision struct {
Skip bool
CacheHit bool
Reason string
DesiredDigest string
ObservedDigest string
HasHooks bool
}
func CheckApplyCache ¶
func CheckApplyCache(ctx context.Context, store *stackStateStore, key ApplyCacheKey, runID string, computeDesired applyCacheDesiredFunc, computeObserved applyCacheObservedFunc) (ApplyCacheDecision, error)
type ApplyCacheEntry ¶
type ApplyCacheKey ¶
type ApplyOptions ¶
type ApplyOptions struct {
Atomic *bool `yaml:"atomic,omitempty" json:"atomic,omitempty"`
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Wait *bool `yaml:"wait,omitempty" json:"wait,omitempty"`
CreateNamespace *bool `yaml:"createNamespace,omitempty" json:"createNamespace,omitempty"`
}
type BackfillSpec ¶ added in v1.0.9
type BackfillSpec struct {
CheckpointTable string `yaml:"checkpointTable,omitempty" json:"checkpointTable,omitempty"`
CheckpointKey string `yaml:"checkpointKey,omitempty" json:"checkpointKey,omitempty"`
StartSQL string `yaml:"startSQL,omitempty" json:"startSQL,omitempty"`
EndSQL string `yaml:"endSQL,omitempty" json:"endSQL,omitempty"`
BatchSQL string `yaml:"batchSQL,omitempty" json:"batchSQL,omitempty"`
BatchSize int64 `yaml:"batchSize,omitempty" json:"batchSize,omitempty"`
BatchSleep *time.Duration `yaml:"batchSleep,omitempty" json:"batchSleep,omitempty"`
MaxBatches int `yaml:"maxBatches,omitempty" json:"maxBatches,omitempty"`
}
type BudgetWaitFields ¶
func (BudgetWaitFields) Map ¶
func (f BudgetWaitFields) Map() map[string]any
type BundleKey ¶
type BundleKey struct {
APIVersion string `json:"apiVersion"`
Type string `json:"type"` // ed25519
PublicKey string `json:"publicKey"`
// PrivateKey is base64 of ed25519.PrivateKey (64 bytes).
PrivateKey string `json:"privateKey,omitempty"`
// Seed is base64 of 32-byte seed (optional alternative).
Seed string `json:"seed,omitempty"`
}
func GenerateEd25519Key ¶
func LoadBundleKey ¶
type BundleMissingNodeError ¶
type BundleMissingNodeError struct {
NodeID string
}
func (*BundleMissingNodeError) Error ¶
func (e *BundleMissingNodeError) Error() string
type BundleSignature ¶
type BundleSignature struct {
APIVersion string `json:"apiVersion"`
CreatedAt string `json:"createdAt"`
Algorithm string `json:"algorithm"` // ed25519
PublicKey string `json:"publicKey"`
ManifestSHA256 string `json:"manifestSha256"`
Signature string `json:"signature"`
}
func SignBundle ¶
func SignBundle(bundlePath string, priv ed25519.PrivateKey) (*BundleSignature, error)
func VerifyBundle ¶
func VerifyBundle(bundlePath string, trustedPub ed25519.PublicKey) (*BundleSignature, error)
type ClusterTarget ¶
type CompileOptions ¶
type CompileOptions struct {
Profile string
}
type ConcurrencyFields ¶
type ConcurrencyFields struct {
From int
To int
Reason string
Class string
Window int
FailRate float64
}
func (ConcurrencyFields) Map ¶
func (f ConcurrencyFields) Map() map[string]any
type DatabaseSpec ¶ added in v1.0.9
type DatabaseSpec struct {
Driver string `yaml:"driver,omitempty" json:"driver,omitempty"`
DSN string `yaml:"dsn,omitempty" json:"-"`
DSNEnv string `yaml:"dsnEnv,omitempty" json:"dsnEnv,omitempty"`
MetadataTable string `yaml:"metadataTable,omitempty" json:"metadataTable,omitempty"`
RestorePointSQL string `yaml:"restorePointSQL,omitempty" json:"restorePointSQL,omitempty"`
ExpandSQL string `yaml:"expandSQL,omitempty" json:"expandSQL,omitempty"`
ContractSQL string `yaml:"contractSQL,omitempty" json:"contractSQL,omitempty"`
PrepareSQL string `yaml:"prepareSQL,omitempty" json:"prepareSQL,omitempty"`
ArmSQL string `yaml:"armSQL,omitempty" json:"armSQL,omitempty"`
CommitSQL string `yaml:"commitSQL,omitempty" json:"commitSQL,omitempty"`
VerifySQL string `yaml:"verifySQL,omitempty" json:"verifySQL,omitempty"`
FinalizeSQL string `yaml:"finalizeSQL,omitempty" json:"finalizeSQL,omitempty"`
VerifyExpectMessage string `yaml:"verifyExpectMessage,omitempty" json:"verifyExpectMessage,omitempty"`
StabilizationWindow *time.Duration `yaml:"stabilizationWindow,omitempty" json:"stabilizationWindow,omitempty"`
RequireFencing *bool `yaml:"requireFencing,omitempty" json:"requireFencing,omitempty"`
AmbiguityPolicy string `yaml:"ambiguityPolicy,omitempty" json:"ambiguityPolicy,omitempty"`
Backfill BackfillSpec `yaml:"backfill,omitempty" json:"backfill,omitempty"`
}
type DeleteOptions ¶
type EffectiveActionInput ¶ added in v1.0.9
type EffectiveApplyInput ¶
type EffectiveBackfillInput ¶ added in v1.0.9
type EffectiveBackfillInput struct {
CheckpointTable string `json:"checkpointTable,omitempty"`
CheckpointKey string `json:"checkpointKey,omitempty"`
StartDigest string `json:"startDigest,omitempty"`
EndDigest string `json:"endDigest,omitempty"`
BatchDigest string `json:"batchDigest,omitempty"`
BatchSize int64 `json:"batchSize,omitempty"`
BatchSleep string `json:"batchSleep,omitempty"`
MaxBatches int `json:"maxBatches,omitempty"`
}
type EffectiveChartInput ¶
type EffectiveDatabaseInput ¶ added in v1.0.9
type EffectiveDatabaseInput struct {
Driver string `json:"driver,omitempty"`
DSNRef string `json:"dsnRef,omitempty"`
MetadataTable string `json:"metadataTable,omitempty"`
RestorePointDigest string `json:"restorePointDigest,omitempty"`
ExpandDigest string `json:"expandDigest,omitempty"`
ContractDigest string `json:"contractDigest,omitempty"`
PrepareDigest string `json:"prepareDigest,omitempty"`
ArmDigest string `json:"armDigest,omitempty"`
CommitDigest string `json:"commitDigest,omitempty"`
VerifyDigest string `json:"verifyDigest,omitempty"`
FinalizeDigest string `json:"finalizeDigest,omitempty"`
VerifyExpectMessage string `json:"verifyExpectMessage,omitempty"`
Backfill EffectiveBackfillInput `json:"backfill,omitempty"`
StabilizationWindow string `json:"stabilizationWindow,omitempty"`
RequireFencing bool `json:"requireFencing,omitempty"`
AmbiguityPolicy string `json:"ambiguityPolicy,omitempty"`
Digest string `json:"digest,omitempty"`
}
type EffectiveDeleteInput ¶
type EffectiveHostInput ¶ added in v1.0.9
type EffectiveHostInput struct {
Transport string `json:"transport,omitempty"`
TargetDigest string `json:"targetDigest,omitempty"`
TargetEnv string `json:"targetEnv,omitempty"`
CommandDigest string `json:"commandDigest,omitempty"`
DeleteDigest string `json:"deleteDigest,omitempty"`
Timeout string `json:"timeout,omitempty"`
Digest string `json:"digest,omitempty"`
}
type EffectiveInput ¶
type EffectiveInput struct {
APIVersion string `json:"apiVersion"`
StackGitCommit string `json:"stackGitCommit,omitempty"`
StackGitDirty bool `json:"stackGitDirty,omitempty"`
TorqueVersion string `json:"torqueVersion,omitempty"`
TorqueGitCommit string `json:"torqueGitCommit,omitempty"`
NodeID string `json:"nodeId"`
Kind string `json:"kind,omitempty"`
Chart EffectiveChartInput `json:"chart"`
Values []FileDigest `json:"values,omitempty"`
SetDigest string `json:"setDigest,omitempty"`
ClusterDigest string `json:"clusterDigest,omitempty"`
ActionDigest string `json:"actionDigest,omitempty"`
DatabaseDigest string `json:"databaseDigest,omitempty"`
HostDigest string `json:"hostDigest,omitempty"`
KubernetesDigest string `json:"kubernetesDigest,omitempty"`
Apply EffectiveApplyInput `json:"apply"`
Delete EffectiveDeleteInput `json:"delete"`
Verify EffectiveVerifyInput `json:"verify"`
}
func ComputeEffectiveInputHash ¶
func ComputeEffectiveInputHash(stackRoot string, n *ResolvedRelease, includeValuesContents bool) (string, *EffectiveInput, error)
func ComputeEffectiveInputHashWithOptions ¶
func ComputeEffectiveInputHashWithOptions(n *ResolvedRelease, opts EffectiveInputHashOptions) (string, *EffectiveInput, error)
type EffectiveInputHashOptions ¶
type EffectiveInputHashOptions struct {
StackRoot string
IncludeValuesContents bool
StackGitIdentity *GitIdentity
}
type EffectiveKubernetesInput ¶ added in v1.0.9
type EffectiveKubernetesInput struct {
Provider string `json:"provider,omitempty"`
ClusterDigest string `json:"clusterDigest,omitempty"`
TargetDigests []string `json:"targetDigests,omitempty"`
RenewBefore string `json:"renewBefore,omitempty"`
Force bool `json:"force,omitempty"`
ForceOnceID string `json:"forceOnceId,omitempty"`
StatePathDigest string `json:"statePathDigest,omitempty"`
Services []string `json:"services,omitempty"`
Order string `json:"order,omitempty"`
BatchSize int `json:"batchSize,omitempty"`
HealthDigest string `json:"healthDigest,omitempty"`
VerifyCommandDigest string `json:"verifyCommandDigest,omitempty"`
PolicyDigest string `json:"policyDigest,omitempty"`
Digest string `json:"digest,omitempty"`
}
type EffectiveVerifyInput ¶
type EffectiveVerifyInput struct {
Enabled bool `json:"enabled"`
FailOnWarnings bool `json:"failOnWarnings"`
WarnOnly bool `json:"warnOnly"`
EventsWindow string `json:"eventsWindow"`
Timeout string `json:"timeout"`
DenyReasons []string `json:"denyReasons,omitempty"`
AllowReasons []string `json:"allowReasons,omitempty"`
RequireConditions []VerifyConditionRequirement `json:"requireConditions,omitempty"`
Digest string `json:"digest,omitempty"`
}
type FailureCluster ¶
type FileDigest ¶
type GitIdentity ¶
func GitIdentityForRoot ¶
func GitIdentityForRoot(root string) (GitIdentity, error)
GitIdentityForRoot returns the current git HEAD commit and whether the working tree is dirty. If root is not a git work tree, it returns an empty commit and Dirty=false.
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func BuildGraph ¶
func (*Graph) DependentsOf ¶
type HTTPHookConfig ¶
type HookSpec ¶
type HookSpec struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Type string `yaml:"type,omitempty" json:"type,omitempty"` // kubectl|script|http
RunOnce bool `yaml:"runOnce,omitempty" json:"runOnce,omitempty"`
When string `yaml:"when,omitempty" json:"when,omitempty"` // success|failure|always
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Retry *int `yaml:"retry,omitempty" json:"retry,omitempty"` // max attempts, includes the initial attempt
Kubeconfig string `yaml:"kubeconfig,omitempty" json:"kubeconfig,omitempty"`
Context string `yaml:"context,omitempty" json:"context,omitempty"`
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
Kubectl *KubectlHookConfig `yaml:"kubectl,omitempty" json:"kubectl,omitempty"`
Script *ScriptHookConfig `yaml:"script,omitempty" json:"script,omitempty"`
HTTP *HTTPHookConfig `yaml:"http,omitempty" json:"http,omitempty"`
}
type HostCommandSpec ¶ added in v1.0.9
type HostCommandSpec struct {
Transport string `yaml:"transport,omitempty" json:"transport,omitempty"`
Target string `yaml:"target,omitempty" json:"target,omitempty"`
TargetEnv string `yaml:"targetEnv,omitempty" json:"targetEnv,omitempty"`
Command string `yaml:"command,omitempty" json:"command,omitempty"`
DeleteCommand string `yaml:"deleteCommand,omitempty" json:"deleteCommand,omitempty"`
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
}
type InferDepsOptions ¶
type InferDepsOptions struct {
IncludeConfigRefs bool
Secrets *deploy.SecretOptions
}
type InferredNeed ¶
type InferredNeed struct {
Name string `json:"name"`
Reasons []InferredReason `json:"reasons,omitempty"`
}
type InferredReason ¶
type InputBundleManifest ¶
type InputBundleManifest struct {
APIVersion string `json:"apiVersion"`
CreatedAt string `json:"createdAt"`
PlanHash string `json:"planHash,omitempty"`
Nodes []InputBundleNode `json:"nodes"`
}
func ExtractInputBundle ¶
func WriteInputBundle ¶
func WriteInputBundle(ctx context.Context, outPath string, planHash string, nodes []*ResolvedRelease) (*InputBundleManifest, string, error)
WriteInputBundle writes a portable .tar.gz containing the Helm chart contents and values files required by the provided nodes. The returned digest is for the compressed bundle bytes.
type InputBundleNode ¶
type InputBundleNode struct {
ID string `json:"id"`
Kind string `json:"kind,omitempty"`
ChartDir string `json:"chartDir,omitempty"`
Values []InputBundleValue `json:"values,omitempty"`
}
type InputBundleValue ¶
type KubectlHookConfig ¶
type KubectlHookConfig struct {
Args []string `yaml:"args,omitempty" json:"args,omitempty"`
}
type KubernetesAppProbe ¶ added in v1.0.9
type KubernetesCertSpec ¶ added in v1.0.9
type KubernetesCertSpec struct {
Targets []KubernetesCertTarget `yaml:"targets,omitempty" json:"targets,omitempty"`
TargetsFrom KubernetesCertTargetsFromSpec `yaml:"targetsFrom,omitempty" json:"targetsFrom,omitempty"`
RenewBefore *time.Duration `yaml:"renewBefore,omitempty" json:"renewBefore,omitempty"`
Force bool `yaml:"force,omitempty" json:"force,omitempty"`
ForceOnceID string `yaml:"forceOnceId,omitempty" json:"forceOnceId,omitempty"`
StatePath string `yaml:"statePath,omitempty" json:"statePath,omitempty"`
Services []string `yaml:"services,omitempty" json:"services,omitempty"`
Order string `yaml:"order,omitempty" json:"order,omitempty"`
BatchSize int `yaml:"batchSize,omitempty" json:"batchSize,omitempty"`
HealthCheckCommand string `yaml:"healthCheckCommand,omitempty" json:"healthCheckCommand,omitempty"`
VerifyCommand string `yaml:"verifyCommand,omitempty" json:"verifyCommand,omitempty"`
Policy KubernetesLifecyclePolicySpec `yaml:"policy,omitempty" json:"policy,omitempty"`
}
type KubernetesCertTarget ¶ added in v1.0.9
type KubernetesCertTarget struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Role string `yaml:"role,omitempty" json:"role,omitempty"`
Provider string `yaml:"provider,omitempty" json:"provider,omitempty"`
Transport string `yaml:"transport,omitempty" json:"transport,omitempty"`
Target string `yaml:"target,omitempty" json:"target,omitempty"`
TargetEnv string `yaml:"targetEnv,omitempty" json:"targetEnv,omitempty"`
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Service string `yaml:"service,omitempty" json:"service,omitempty"`
NodeAddress string `yaml:"nodeAddress,omitempty" json:"nodeAddress,omitempty"`
NodeIdentityFile string `yaml:"nodeIdentityFile,omitempty" json:"nodeIdentityFile,omitempty"`
NodeSSHOptions string `yaml:"nodeSshOptions,omitempty" json:"nodeSshOptions,omitempty"`
InspectCommand string `yaml:"inspectCommand,omitempty" json:"inspectCommand,omitempty"`
RenewCommand string `yaml:"renewCommand,omitempty" json:"renewCommand,omitempty"`
RestartCommand string `yaml:"restartCommand,omitempty" json:"restartCommand,omitempty"`
}
type KubernetesCertTargetsFromSpec ¶ added in v1.0.9
type KubernetesCertTargetsFromSpec struct {
SourceNode string `yaml:"sourceNode,omitempty" json:"sourceNode,omitempty"`
SourceNodeID string `yaml:"sourceNodeId,omitempty" json:"sourceNodeId,omitempty"`
Artifact string `yaml:"artifact,omitempty" json:"artifact,omitempty"`
Roles []string `yaml:"roles,omitempty" json:"roles,omitempty"`
IncludeNotReady bool `yaml:"includeNotReady,omitempty" json:"includeNotReady,omitempty"`
AddressType string `yaml:"addressType,omitempty" json:"addressType,omitempty"`
Transport string `yaml:"transport,omitempty" json:"transport,omitempty"`
Target string `yaml:"target,omitempty" json:"target,omitempty"`
TargetEnv string `yaml:"targetEnv,omitempty" json:"targetEnv,omitempty"`
TargetTemplate string `yaml:"targetTemplate,omitempty" json:"targetTemplate,omitempty"`
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Provider string `yaml:"provider,omitempty" json:"provider,omitempty"`
Service string `yaml:"service,omitempty" json:"service,omitempty"`
NodeAddressTemplate string `yaml:"nodeAddressTemplate,omitempty" json:"nodeAddressTemplate,omitempty"`
NodeIdentityFile string `yaml:"nodeIdentityFile,omitempty" json:"nodeIdentityFile,omitempty"`
NodeSSHOptions string `yaml:"nodeSshOptions,omitempty" json:"nodeSshOptions,omitempty"`
InspectCommand string `yaml:"inspectCommand,omitempty" json:"inspectCommand,omitempty"`
RenewCommand string `yaml:"renewCommand,omitempty" json:"renewCommand,omitempty"`
RestartCommand string `yaml:"restartCommand,omitempty" json:"restartCommand,omitempty"`
}
type KubernetesClusterSpec ¶ added in v1.0.9
type KubernetesClusterSpec struct {
Transport string `yaml:"transport,omitempty" json:"transport,omitempty"`
Target string `yaml:"target,omitempty" json:"target,omitempty"`
TargetEnv string `yaml:"targetEnv,omitempty" json:"targetEnv,omitempty"`
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Kubeconfig string `yaml:"kubeconfig,omitempty" json:"kubeconfig,omitempty"`
KubeconfigEnv string `yaml:"kubeconfigEnv,omitempty" json:"kubeconfigEnv,omitempty"`
Context string `yaml:"context,omitempty" json:"context,omitempty"`
MinReadyNodes int `yaml:"minReadyNodes,omitempty" json:"minReadyNodes,omitempty"`
Namespaces []string `yaml:"namespaces,omitempty" json:"namespaces,omitempty"`
StableIterations int `yaml:"stableIterations,omitempty" json:"stableIterations,omitempty"`
StableInterval *time.Duration `yaml:"stableInterval,omitempty" json:"stableInterval,omitempty"`
ConfigCommand string `yaml:"configCommand,omitempty" json:"configCommand,omitempty"`
APICommand string `yaml:"apiCommand,omitempty" json:"apiCommand,omitempty"`
NodesCommand string `yaml:"nodesCommand,omitempty" json:"nodesCommand,omitempty"`
NamespacesCommand string `yaml:"namespacesCommand,omitempty" json:"namespacesCommand,omitempty"`
PodsCommand string `yaml:"podsCommand,omitempty" json:"podsCommand,omitempty"`
AppProbes []KubernetesAppProbe `yaml:"appProbes,omitempty" json:"appProbes,omitempty"`
}
type KubernetesLifecyclePolicyOverrideScopeSpec ¶ added in v1.0.9
type KubernetesLifecyclePolicyOverrideScopeSpec struct {
NodeID string `yaml:"nodeId,omitempty" json:"nodeId,omitempty"`
RunID string `yaml:"runId,omitempty" json:"runId,omitempty"`
IntentDigest string `yaml:"intentDigest,omitempty" json:"intentDigest,omitempty"`
TargetIDs []string `yaml:"targetIds,omitempty" json:"targetIds,omitempty"`
TargetSetDigest string `yaml:"targetSetDigest,omitempty" json:"targetSetDigest,omitempty"`
}
type KubernetesLifecyclePolicyOverrideSpec ¶ added in v1.0.9
type KubernetesLifecyclePolicyOverrideSpec struct {
Reason string `yaml:"reason,omitempty" json:"reason,omitempty"`
Ticket string `yaml:"ticket,omitempty" json:"ticket,omitempty"`
ChangeID string `yaml:"changeId,omitempty" json:"changeId,omitempty"`
Approver string `yaml:"approver,omitempty" json:"approver,omitempty"`
ExpiresAt string `yaml:"expiresAt,omitempty" json:"expiresAt,omitempty"`
Scope KubernetesLifecyclePolicyOverrideScopeSpec `yaml:"scope,omitempty" json:"scope,omitempty"`
}
type KubernetesLifecyclePolicySpec ¶ added in v1.0.9
type KubernetesLifecyclePolicySpec struct {
RequireFreshInspect bool `yaml:"requireFreshInspect,omitempty" json:"requireFreshInspect,omitempty"`
MaxInspectAge *time.Duration `yaml:"maxInspectAge,omitempty" json:"maxInspectAge,omitempty"`
RequireHealthyInspect bool `yaml:"requireHealthyInspect,omitempty" json:"requireHealthyInspect,omitempty"`
RequireSupportedProvider bool `yaml:"requireSupportedProvider,omitempty" json:"requireSupportedProvider,omitempty"`
MaintenanceWindow KubernetesMaintenanceWindowSpec `yaml:"maintenanceWindow,omitempty" json:"maintenanceWindow,omitempty"`
AppProbes []KubernetesAppProbe `yaml:"appProbes,omitempty" json:"appProbes,omitempty"`
Override KubernetesLifecyclePolicyOverrideSpec `yaml:"override,omitempty" json:"override,omitempty"`
}
type KubernetesMaintenanceWindowSpec ¶ added in v1.0.9
type KubernetesSpec ¶ added in v1.0.9
type KubernetesSpec struct {
Provider string `yaml:"provider,omitempty" json:"provider,omitempty"`
Certificates KubernetesCertSpec `yaml:"certificates,omitempty" json:"certificates,omitempty"`
Cluster KubernetesClusterSpec `yaml:"cluster,omitempty" json:"cluster,omitempty"`
}
type LoadSealedPlanOptions ¶
type LoadSealedPlanOptions struct {
// StateStoreRoot is written into Plan.StackRoot so the run uses the current stack root
// for state storage, even when inputs are loaded from a sealed artifact.
StateStoreRoot string
// Exactly one of SealedDir or BundlePath must be set.
SealedDir string
BundlePath string
VerifyBundle bool
RequireSigned bool
TrustedPubKey []byte
}
type LoadedRun ¶
type NodeDiffSummary ¶
type NodeExecutor ¶
type NodeMetaFields ¶
type NodeMetaFields struct {
Cluster string
Namespace string
Name string
ExecutionGroup int
ParallelismGroup string
PrimaryKind string
Critical bool
}
func (NodeMetaFields) Map ¶
func (f NodeMetaFields) Map() map[string]any
type NodeSpec ¶ added in v1.0.9
type NodeSpec = ReleaseSpec
NodeSpec is the generic stack node config shape. ReleaseSpec remains as the backward-compatible Helm-oriented alias accepted under `releases:`.
type NodeStepCheckpoint ¶
type PhaseFields ¶
func (PhaseFields) Map ¶
func (f PhaseFields) Map() map[string]any
type Plan ¶
type Plan struct {
StackRoot string `json:"stackRoot"`
StackName string `json:"stackName"`
Profile string `json:"profile"`
Nodes []*ResolvedRelease `json:"nodes"`
Order []string `json:"order,omitempty"`
Runner RunnerResolved `json:"runner,omitempty"`
Hooks StackHooksConfig `json:"hooks,omitempty"`
ByID map[string]*ResolvedRelease `json:"-"`
ByCluster map[string][]*ResolvedRelease `json:"-"`
}
func FilterByClusters ¶
func FilterByNodeStatus ¶
func LoadSealedPlan ¶
func LoadSealedPlan(ctx context.Context, opts LoadSealedPlanOptions) (*Plan, func(), error)
LoadSealedPlan loads a run plan (plan.json + inputs.tar.gz) either from a directory produced by `torque stack seal` or from a portable .tgz bundle.
The returned cleanup must be called to remove any temporary extraction directories.
func PlanFromRunPlan ¶
type ReleaseDefaults ¶
type ReleaseDefaults struct {
Cluster ClusterTarget `yaml:"cluster,omitempty" json:"cluster,omitempty"`
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
Values []string `yaml:"values,omitempty" json:"values,omitempty"`
Set map[string]string `yaml:"set,omitempty" json:"set,omitempty"`
Apply ApplyOptions `yaml:"apply,omitempty" json:"apply,omitempty"`
Delete DeleteOptions `yaml:"delete,omitempty" json:"delete,omitempty"`
Verify VerifyOptions `yaml:"verify,omitempty" json:"verify,omitempty"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
Extra map[string]any `yaml:",inline" json:"-"`
RawIgnored map[string]any `yaml:"-" json:"-"`
}
type ReleaseFile ¶
type ReleaseFile struct {
APIVersionKind `yaml:",inline" json:",inline"`
NodeKind string `yaml:"nodeKind,omitempty" json:"nodeKind,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Chart string `yaml:"chart,omitempty" json:"chart,omitempty"`
ChartVersion string `yaml:"chartVersion,omitempty" json:"chartVersion,omitempty"`
Wave int `yaml:"wave,omitempty" json:"wave,omitempty"`
Critical bool `yaml:"critical,omitempty" json:"critical,omitempty"`
Parallelism string `yaml:"parallelismGroup,omitempty" json:"parallelismGroup,omitempty"`
Cluster ClusterTarget `yaml:"cluster,omitempty" json:"cluster,omitempty"`
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
Values []string `yaml:"values,omitempty" json:"values,omitempty"`
Set map[string]string `yaml:"set,omitempty" json:"set,omitempty"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
Needs []string `yaml:"needs,omitempty" json:"needs,omitempty"`
Apply ApplyOptions `yaml:"apply,omitempty" json:"apply,omitempty"`
Delete DeleteOptions `yaml:"delete,omitempty" json:"delete,omitempty"`
Hooks StackHooksConfig `yaml:"hooks,omitempty" json:"hooks,omitempty"`
Action ActionSpec `yaml:"action,omitempty" json:"action,omitempty"`
Database DatabaseSpec `yaml:"database,omitempty" json:"database,omitempty"`
Kubernetes KubernetesSpec `yaml:"kubernetes,omitempty" json:"kubernetes,omitempty"`
}
type ReleaseSpec ¶
type ReleaseSpec struct {
Kind string `yaml:"kind,omitempty" json:"kind,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Chart string `yaml:"chart,omitempty" json:"chart,omitempty"`
ChartVersion string `yaml:"chartVersion,omitempty" json:"chartVersion,omitempty"`
Wave int `yaml:"wave,omitempty" json:"wave,omitempty"`
Critical bool `yaml:"critical,omitempty" json:"critical,omitempty"`
Parallelism string `yaml:"parallelismGroup,omitempty" json:"parallelismGroup,omitempty"`
Cluster ClusterTarget `yaml:"cluster,omitempty" json:"cluster,omitempty"`
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
Values []string `yaml:"values,omitempty" json:"values,omitempty"`
Set map[string]string `yaml:"set,omitempty" json:"set,omitempty"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
Needs []string `yaml:"needs,omitempty" json:"needs,omitempty"`
Apply ApplyOptions `yaml:"apply,omitempty" json:"apply,omitempty"`
Delete DeleteOptions `yaml:"delete,omitempty" json:"delete,omitempty"`
Verify VerifyOptions `yaml:"verify,omitempty" json:"verify,omitempty"`
Hooks StackHooksConfig `yaml:"hooks,omitempty" json:"hooks,omitempty"`
Action ActionSpec `yaml:"action,omitempty" json:"action,omitempty"`
Database DatabaseSpec `yaml:"database,omitempty" json:"database,omitempty"`
Host HostCommandSpec `yaml:"host,omitempty" json:"host,omitempty"`
Kubernetes KubernetesSpec `yaml:"kubernetes,omitempty" json:"kubernetes,omitempty"`
Input map[string]any `yaml:"input,omitempty" json:"input,omitempty"`
}
type ResolvedRelease ¶
type ResolvedRelease struct {
ID string `json:"id"`
Kind string `json:"kind,omitempty"`
Name string `json:"name"`
Dir string `json:"dir"`
Cluster ClusterTarget `json:"cluster"`
Namespace string `json:"namespace"`
Chart string `json:"chart"`
ChartVersion string `json:"chartVersion,omitempty"`
Wave int `json:"wave,omitempty"`
Critical bool `json:"critical,omitempty"`
Parallelism string `json:"parallelismGroup,omitempty"`
Values []string `json:"values"`
Set map[string]string `json:"set"`
Tags []string `json:"tags"`
Needs []string `json:"needs"`
Apply ApplyOptions `json:"apply"`
Delete DeleteOptions `json:"delete"`
Verify VerifyOptions `json:"verify,omitempty"`
Hooks StackHooksConfig `json:"hooks,omitempty"`
Action ActionSpec `json:"action,omitempty"`
Database DatabaseSpec `json:"database,omitempty"`
Host HostCommandSpec `json:"host,omitempty"`
Kubernetes KubernetesSpec `json:"kubernetes,omitempty"`
SelectedBy []string `json:"selectedBy,omitempty"`
InferredNeeds []InferredNeed `json:"inferredNeeds,omitempty"`
InferredRole string `json:"inferredRole,omitempty"`
InferredPrimaryKind string `json:"inferredPrimaryKind,omitempty"`
EffectiveInputHash string `json:"effectiveInputHash,omitempty"`
EffectiveInput *EffectiveInput `json:"effectiveInput,omitempty"`
ExecutionGroup int `json:"executionGroup,omitempty"`
}
type RetryScheduledFields ¶
type RetryScheduledFields struct {
Backoff string
}
func (RetryScheduledFields) Map ¶
func (f RetryScheduledFields) Map() map[string]any
type RunArtifact ¶ added in v1.0.9
type RunArtifact struct {
RunID string `json:"runId"`
NodeID string `json:"nodeId,omitempty"`
Name string `json:"name"`
ContentType string `json:"contentType,omitempty"`
SHA256 string `json:"sha256,omitempty"`
SizeBytes int `json:"sizeBytes,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Body string `json:"body,omitempty"`
}
type RunAudit ¶
type RunAudit struct {
APIVersion string `json:"apiVersion"`
RunID string `json:"runId"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
CompletedAt string `json:"completedAt,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
Host string `json:"host,omitempty"`
PID int `json:"pid,omitempty"`
CIRunURL string `json:"ciRunUrl,omitempty"`
GitAuthor string `json:"gitAuthor,omitempty"`
Kubeconfig string `json:"kubeconfig,omitempty"`
KubeContext string `json:"kubeContext,omitempty"`
StatePath string `json:"statePath,omitempty"`
FollowCommand string `json:"followCommand,omitempty"`
RunDigest string `json:"runDigest,omitempty"`
Integrity RunIntegrity `json:"integrity"`
Summary *RunSummary `json:"summary,omitempty"`
FailureClusters []FailureCluster `json:"failureClusters,omitempty"`
Artifacts []RunArtifact `json:"artifacts,omitempty"`
Plan *RunPlan `json:"plan,omitempty"`
Events []RunEvent `json:"events,omitempty"`
}
func GetRunAudit ¶
func GetRunAudit(ctx context.Context, opts RunAuditOptions) (*RunAudit, error)
type RunAuditOptions ¶
type RunBundleManifest ¶
type RunConsole ¶
type RunConsole struct {
// contains filtered or unexported fields
}
RunConsole renders stack run events into a single in-place updating TTY view. It is event-driven: callers should feed RunEvent values via ObserveRunEvent.
func NewRunConsole ¶
func NewRunConsole(out io.Writer, plan *Plan, command string, opts RunConsoleOptions) *RunConsole
func (*RunConsole) Done ¶
func (c *RunConsole) Done()
func (*RunConsole) ObserveRunEvent ¶
func (c *RunConsole) ObserveRunEvent(ev RunEvent)
func (*RunConsole) SnapshotLines ¶
func (c *RunConsole) SnapshotLines() []string
SnapshotLines returns the current console surface as plain lines (no cursor movement). It is intended for tests and debugging.
type RunConsoleOptions ¶
type RunConsoleOptions struct {
Enabled bool
Verbose bool
Width int
// ShowNoisyPhases forces the Phase column to include phases that are normally
// suppressed in non-verbose mode (e.g. pre-apply/post-apply).
ShowNoisyPhases bool
// NodeFilter controls which nodes are shown in the node table.
// Supported values: all|running|failed.
NodeFilter string
// ShowHooks renders a recent-hook activity panel below the node table.
ShowHooks bool
// HookTail caps stored hook events in the HOOKS panel (0 uses a default).
HookTail int
// ShowDetails renders an expanded per-node details panel (hooks + helm tail).
ShowDetails bool
// DetailsTail caps lines shown per node in the details panel (0 uses a default).
DetailsTail int
// Now returns the current time for elapsed calculations. Defaults to time.Now.
Now func() time.Time
// Color toggles ANSI styling for the TTY surface.
Color bool
// ShowHelmLogs renders HELM_LOG events under each node.
ShowHelmLogs bool
// CaptureHelmLogs stores HELM_LOG events for failure hints and the details
// panel even when ShowHelmLogs is false.
CaptureHelmLogs bool
// HelmLogsMode controls which nodes are included in the HELM LOGS section.
// Supported values: off|on|all. "on" shows only non-succeeded nodes.
HelmLogsMode string
// HelmLogTail caps stored log lines per node (0 uses a default).
HelmLogTail int
}
type RunEvent ¶
type RunEvent struct {
Seq int64 `json:"seq,omitempty"`
TS string `json:"ts"`
RunID string `json:"runId"`
NodeID string `json:"nodeId,omitempty"`
Type string `json:"type"`
Attempt int `json:"attempt"`
Message string `json:"message,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
Error *RunError `json:"error,omitempty"`
PrevDigest string `json:"prevDigest,omitempty"`
Digest string `json:"digest,omitempty"`
CRC32 string `json:"crc32,omitempty"`
}
type RunEventObserver ¶
type RunEventObserver interface {
ObserveRunEvent(RunEvent)
}
type RunEventObserverFunc ¶
type RunEventObserverFunc func(RunEvent)
func (RunEventObserverFunc) ObserveRunEvent ¶
func (f RunEventObserverFunc) ObserveRunEvent(ev RunEvent)
type RunEventType ¶
type RunEventType string
RunEventType enumerates structured stack run events.
These values are persisted in the sqlite state store and are consumed by `torque stack status --follow` and the stack run renderers.
const ( RunStarted RunEventType = "RUN_STARTED" RunCompleted RunEventType = "RUN_COMPLETED" RunConcurrency RunEventType = "RUN_CONCURRENCY" RunFinalizing RunEventType = "RUN_FINALIZING" RunFinalized RunEventType = "RUN_FINALIZED" NodeMeta RunEventType = "NODE_META" NodeQueued RunEventType = "NODE_QUEUED" NodeRunning RunEventType = "NODE_RUNNING" NodeSucceeded RunEventType = "NODE_SUCCEEDED" NodeFailed RunEventType = "NODE_FAILED" NodeBlocked RunEventType = "NODE_BLOCKED" PhaseStarted RunEventType = "PHASE_STARTED" PhaseCompleted RunEventType = "PHASE_COMPLETED" HookStarted RunEventType = "HOOK_STARTED" HookSucceeded RunEventType = "HOOK_SUCCEEDED" HookFailed RunEventType = "HOOK_FAILED" HookSkipped RunEventType = "HOOK_SKIPPED" StackHooksStarted RunEventType = "STACK_HOOKS_STARTED" StackHooksCompleted RunEventType = "STACK_HOOKS_COMPLETED" BudgetWait RunEventType = "BUDGET_WAIT" RetryScheduled RunEventType = "RETRY_SCHEDULED" // NodeLog is an ephemeral, non-durable event used for verbose rendering. // It is not expected to be stored in sqlite. NodeLog RunEventType = "NODE_LOG" // HelmLog is an optional, durable log stream captured from Helm operations. // It is intended to be stored in sqlite when enabled by the caller. HelmLog RunEventType = "HELM_LOG" )
type RunIndexEntry ¶
type RunIndexEntry struct {
RunID string `json:"runId"`
RunRoot string `json:"runRoot"`
StackName string `json:"stackName,omitempty"`
Profile string `json:"profile,omitempty"`
Status string `json:"status,omitempty"`
StartedAt string `json:"startedAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
Totals RunTotals `json:"totals,omitempty"`
HasSummary bool `json:"hasSummary"`
}
RunIndexEntry is a compact summary of a run, used by `torque stack runs`.
type RunIntegrity ¶
type RunIntegrity struct {
EventsOK bool `json:"eventsOk"`
EventsError string `json:"eventsError,omitempty"`
LastEventDigest string `json:"lastEventDigest,omitempty"`
StoredLastDigest string `json:"storedLastDigest,omitempty"`
RunDigestOK bool `json:"runDigestOk"`
RunDigestExpected string `json:"runDigestExpected,omitempty"`
RunDigestStored string `json:"runDigestStored,omitempty"`
RunDigestError string `json:"runDigestError,omitempty"`
}
type RunNodeSummary ¶
type RunOptions ¶
type RunOptions struct {
Command string
Plan *Plan
Concurrency int
FailFast bool
AutoApprove bool
DryRun bool
Diff bool
CacheApply bool
PolicyOverride bool
Executor NodeExecutor
Secrets *deploy.SecretOptions
HelmLogs bool
KubeQPS float32
KubeBurst int
MaxConcurrencyPerNamespace int
MaxConcurrencyByKind map[string]int
ParallelismGroupLimit int
Adaptive *AdaptiveConcurrencyOptions
ResumeStatusByID map[string]string
ResumeFromRunID string
ResumeAttemptByID map[string]int
ResumeStepsByID map[string]map[int]map[string]NodeStepCheckpoint
ProgressiveConcurrency bool
Lock bool
LockOwner string
LockTTL time.Duration
TakeoverLock bool
Kubeconfig *string
KubeContext *string
LogLevel *string
RemoteAgentAddr *string
RunID string
Selector RunSelector
FailMode string
MaxAttempts int
InitialAttempts map[string]int
EventObservers []RunEventObserver
}
type RunPlan ¶
type RunPlan struct {
APIVersion string `json:"apiVersion"`
RunID string `json:"runId"`
PlanHash string `json:"planHash,omitempty"`
StackRoot string `json:"stackRoot"`
StackName string `json:"stackName"`
Command string `json:"command"`
Profile string `json:"profile"`
Concurrency int `json:"concurrency"`
FailMode string `json:"failMode"`
Selector RunSelector `json:"selector,omitempty"`
Nodes []*ResolvedRelease `json:"nodes"`
Runner RunnerResolved `json:"runner,omitempty"`
StackGitCommit string `json:"stackGitCommit,omitempty"`
StackGitDirty bool `json:"stackGitDirty,omitempty"`
TorqueVersion string `json:"torqueVersion,omitempty"`
TorqueGitCommit string `json:"torqueGitCommit,omitempty"`
}
type RunSelector ¶
type RunSelector struct {
Clusters []string `json:"clusters,omitempty"`
Tags []string `json:"tags,omitempty"`
FromPaths []string `json:"fromPaths,omitempty"`
Releases []string `json:"releases,omitempty"`
GitRange string `json:"gitRange,omitempty"`
GitIncludeDeps bool `json:"gitIncludeDeps,omitempty"`
GitIncludeDependents bool `json:"gitIncludeDependents,omitempty"`
IncludeDeps bool `json:"includeDeps,omitempty"`
IncludeDependents bool `json:"includeDependents,omitempty"`
AllowMissingDeps bool `json:"allowMissingDeps,omitempty"`
}
type RunSummary ¶
type RunSummary struct {
APIVersion string `json:"apiVersion"`
RunID string `json:"runId"`
Status string `json:"status"`
StartedAt string `json:"startedAt"`
UpdatedAt string `json:"updatedAt"`
Totals RunTotals `json:"totals"`
Nodes map[string]RunNodeSummary `json:"nodes"`
Order []string `json:"order,omitempty"`
}
type RunnerAdaptive ¶
type RunnerAdaptive struct {
Mode string `yaml:"mode,omitempty" json:"mode,omitempty"`
Min *int `yaml:"min,omitempty" json:"min,omitempty"`
Window *int `yaml:"window,omitempty" json:"window,omitempty"`
RampAfterSuccesses *int `yaml:"rampAfterSuccesses,omitempty" json:"rampAfterSuccesses,omitempty"`
RampMaxFailureRate *float64 `yaml:"rampMaxFailureRate,omitempty" json:"rampMaxFailureRate,omitempty"`
CooldownSevere *int `yaml:"cooldownSevere,omitempty" json:"cooldownSevere,omitempty"`
}
type RunnerAdaptiveResolved ¶
type RunnerAdaptiveResolved struct {
Mode string `json:"mode,omitempty"`
Min int `json:"min,omitempty"`
Window int `json:"window,omitempty"`
RampAfterSuccesses int `json:"rampAfterSuccesses,omitempty"`
RampMaxFailureRate float64 `json:"rampMaxFailureRate,omitempty"`
CooldownSevere int `json:"cooldownSevere,omitempty"`
}
type RunnerConfig ¶
type RunnerConfig struct {
Concurrency *int `yaml:"concurrency,omitempty" json:"concurrency,omitempty"`
ProgressiveConcurrency *bool `yaml:"progressiveConcurrency,omitempty" json:"progressiveConcurrency,omitempty"`
KubeQPS *float32 `yaml:"kubeQPS,omitempty" json:"kubeQPS,omitempty"`
KubeBurst *int `yaml:"kubeBurst,omitempty" json:"kubeBurst,omitempty"`
Limits RunnerLimits `yaml:"limits,omitempty" json:"limits,omitempty"`
Adaptive RunnerAdaptive `yaml:"adaptive,omitempty" json:"adaptive,omitempty"`
Extra map[string]any `yaml:",inline" json:"-"`
RawIgnored map[string]any `yaml:"-" json:"-"`
}
type RunnerLimits ¶
type RunnerLimits struct {
MaxParallelPerNamespace *int `yaml:"maxParallelPerNamespace,omitempty" json:"maxParallelPerNamespace,omitempty"`
MaxParallelKind map[string]int `yaml:"maxParallelKind,omitempty" json:"maxParallelKind,omitempty"`
ParallelismGroupLimit *int `yaml:"parallelismGroupLimit,omitempty" json:"parallelismGroupLimit,omitempty"`
}
type RunnerLimitsResolved ¶
type RunnerResolved ¶
type RunnerResolved struct {
Concurrency int `json:"concurrency"`
ProgressiveConcurrency bool `json:"progressiveConcurrency"`
KubeQPS float32 `json:"kubeQPS,omitempty"`
KubeBurst int `json:"kubeBurst,omitempty"`
Limits RunnerLimitsResolved `json:"limits,omitempty"`
Adaptive RunnerAdaptiveResolved `json:"adaptive,omitempty"`
}
func ResolveRunnerConfig ¶
func ResolveRunnerConfig(u *Universe, profile string) (RunnerResolved, error)
type ScriptHookConfig ¶
type SealedPlanError ¶
type SealedPlanError struct {
Kind SealedPlanErrorKind
NodeID string
Want string
Got string
}
func (*SealedPlanError) Error ¶
func (e *SealedPlanError) Error() string
type SealedPlanErrorKind ¶
type SealedPlanErrorKind string
const ( SealedPlanErrAttestationPlanHashMismatch SealedPlanErrorKind = "attestation_plan_hash_mismatch" SealedPlanErrBundleDigestMismatch SealedPlanErrorKind = "bundle_digest_mismatch" SealedPlanErrPlanHashMismatch SealedPlanErrorKind = "plan_hash_mismatch" SealedPlanErrBundlePlanHashMismatch SealedPlanErrorKind = "bundle_plan_hash_mismatch" SealedPlanErrInputHashMismatch SealedPlanErrorKind = "input_hash_mismatch" )
type SelectResult ¶
type SelectResult struct {
Plan *Plan
Selected []*ResolvedRelease
}
type Selector ¶
type Selector struct {
Tags []string
FromPaths []string
Releases []string
GitRange string
GitIncludeDeps bool
GitIncludeDependents bool
IncludeDeps bool
IncludeDependents bool
// AllowMissingDeps relaxes validation and treats missing needs as "skipped":
// the selected plan is pruned so nodes only depend on other selected nodes.
AllowMissingDeps bool
}
type StackApplyCLIConfig ¶
type StackApplyCLIConfig struct {
DryRun *bool `yaml:"dryRun,omitempty" json:"dryRun,omitempty"`
Diff *bool `yaml:"diff,omitempty" json:"diff,omitempty"`
FailFast *bool `yaml:"failFast,omitempty" json:"failFast,omitempty"`
Retry *int `yaml:"retry,omitempty" json:"retry,omitempty"`
Lock StackLockCLIConfig `yaml:"lock,omitempty" json:"lock,omitempty"`
}
type StackCLIConfig ¶
type StackCLIConfig struct {
// Selector sets default release selection constraints.
Selector StackSelectorConfig `yaml:"selector,omitempty" json:"selector,omitempty"`
// InferDeps controls whether selection includes inferred edges via manifest rendering.
InferDeps *bool `yaml:"inferDeps,omitempty" json:"inferDeps,omitempty"`
InferConfigRefs *bool `yaml:"inferConfigRefs,omitempty" json:"inferConfigRefs,omitempty"`
// Output sets default output format for commands that support it (e.g. plan/runs).
Output string `yaml:"output,omitempty" json:"output,omitempty"`
// Apply/Delete are CLI defaults specific to the run commands.
Apply StackApplyCLIConfig `yaml:"apply,omitempty" json:"apply,omitempty"`
Delete StackDeleteCLIConfig `yaml:"delete,omitempty" json:"delete,omitempty"`
Resume StackResumeCLIConfig `yaml:"resume,omitempty" json:"resume,omitempty"`
}
StackCLIConfig controls default CLI behavior for `torque stack ...` subcommands. Flags and environment variables can override these settings.
type StackCLIResolved ¶
type StackCLIResolved struct {
Clusters []string
Selector Selector
InferDeps bool
InferConfigRefs bool
Output string
ApplyDryRun *bool
ApplyDiff *bool
ApplyFailFast *bool
ApplyRetry *int
ApplyLock *bool
ApplyTakeover *bool
ApplyLockTTL *time.Duration
ApplyLockOwner *string
DeleteConfirmThreshold *int
DeleteFailFast *bool
DeleteRetry *int
DeleteLock *bool
DeleteTakeover *bool
DeleteLockTTL *time.Duration
DeleteLockOwner *string
ResumeAllowDrift *bool
ResumeRerunFailed *bool
}
func ResolveStackCLIConfig ¶
func ResolveStackCLIConfig(u *Universe, profile string) (StackCLIResolved, error)
type StackDeleteCLIConfig ¶
type StackDeleteCLIConfig struct {
ConfirmThreshold *int `yaml:"confirmThreshold,omitempty" json:"confirmThreshold,omitempty"`
FailFast *bool `yaml:"failFast,omitempty" json:"failFast,omitempty"`
Retry *int `yaml:"retry,omitempty" json:"retry,omitempty"`
Lock StackLockCLIConfig `yaml:"lock,omitempty" json:"lock,omitempty"`
}
type StackDiffSummary ¶
type StackDiffSummary struct {
APIVersion string `json:"apiVersion"`
CreatedAt string `json:"createdAt,omitempty"`
PlanHash string `json:"planHash"`
Nodes map[string]NodeDiffSummary `json:"nodes"`
}
func BuildStackDiffSummary ¶
func BuildStackDiffSummary(ctx context.Context, p *Plan, defaultKubeconfig string, defaultKubeContext string, planHash string, secrets *deploy.SecretOptions) (*StackDiffSummary, error)
type StackFile ¶
type StackFile struct {
APIVersionKind `yaml:",inline" json:",inline"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
DefaultProfile string `yaml:"defaultProfile,omitempty" json:"defaultProfile,omitempty"`
Profiles map[string]StackProfile `yaml:"profiles,omitempty" json:"profiles,omitempty"`
Defaults ReleaseDefaults `yaml:"defaults,omitempty" json:"defaults,omitempty"`
Runner RunnerConfig `yaml:"runner,omitempty" json:"runner,omitempty"`
CLI StackCLIConfig `yaml:"cli,omitempty" json:"cli,omitempty"`
Hooks StackHooksConfig `yaml:"hooks,omitempty" json:"hooks,omitempty"`
Releases []ReleaseSpec `yaml:"releases,omitempty" json:"releases,omitempty"`
Nodes []NodeSpec `yaml:"nodes,omitempty" json:"nodes,omitempty"`
}
type StackHooksConfig ¶
type StackHooksConfig struct {
PreApply []HookSpec `yaml:"preApply,omitempty" json:"preApply,omitempty"`
PostApply []HookSpec `yaml:"postApply,omitempty" json:"postApply,omitempty"`
PreDelete []HookSpec `yaml:"preDelete,omitempty" json:"preDelete,omitempty"`
PostDelete []HookSpec `yaml:"postDelete,omitempty" json:"postDelete,omitempty"`
}
func ResolveStackHooksConfig ¶
func ResolveStackHooksConfig(u *Universe, profile string) (StackHooksConfig, error)
type StackLockCLIConfig ¶
type StackPlanBundleManifest ¶
type StackPlanBundleManifest struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
CreatedAt string `json:"createdAt,omitempty"`
PlanHash string `json:"planHash"`
InputsBundleSha256 string `json:"inputsBundleSha256,omitempty"`
StackName string `json:"stackName,omitempty"`
Profile string `json:"profile,omitempty"`
}
type StackProfile ¶
type StackProfile struct {
Defaults ReleaseDefaults `yaml:"defaults,omitempty" json:"defaults,omitempty"`
Runner RunnerConfig `yaml:"runner,omitempty" json:"runner,omitempty"`
CLI StackCLIConfig `yaml:"cli,omitempty" json:"cli,omitempty"`
Hooks StackHooksConfig `yaml:"hooks,omitempty" json:"hooks,omitempty"`
}
type StackResumeCLIConfig ¶
type StackSelectorConfig ¶
type StackSelectorConfig struct {
Clusters []string `yaml:"clusters,omitempty" json:"clusters,omitempty"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
FromPaths []string `yaml:"fromPaths,omitempty" json:"fromPaths,omitempty"`
Releases []string `yaml:"releases,omitempty" json:"releases,omitempty"`
GitRange string `yaml:"gitRange,omitempty" json:"gitRange,omitempty"`
GitIncludeDeps *bool `yaml:"gitIncludeDeps,omitempty" json:"gitIncludeDeps,omitempty"`
GitIncludeDependents *bool `yaml:"gitIncludeDependents,omitempty" json:"gitIncludeDependents,omitempty"`
IncludeDeps *bool `yaml:"includeDeps,omitempty" json:"includeDeps,omitempty"`
IncludeDependents *bool `yaml:"includeDependents,omitempty" json:"includeDependents,omitempty"`
AllowMissingDeps *bool `yaml:"allowMissingDeps,omitempty" json:"allowMissingDeps,omitempty"`
}
type StatusOptions ¶
type Universe ¶
type VerifyCacheEntry ¶
type VerifyCacheKey ¶
type VerifyConditionRequirement ¶
type VerifyConditionRequirement struct {
Group string `yaml:"group,omitempty" json:"group,omitempty"` // e.g. example.com
Kind string `yaml:"kind,omitempty" json:"kind,omitempty"` // e.g. Widget
ConditionType string `yaml:"type,omitempty" json:"type,omitempty"` // e.g. Ready
RequireStatus string `yaml:"status,omitempty" json:"status,omitempty"` // True|False|Unknown
AllowMissing bool `yaml:"allowMissing,omitempty" json:"allowMissing,omitempty"`
}
type VerifyOptions ¶
type VerifyOptions struct {
// Enabled toggles post-apply verification for this release.
Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
// FailOnWarnings fails the release when matching Warning events are observed.
FailOnWarnings *bool `yaml:"failOnWarnings,omitempty" json:"failOnWarnings,omitempty"`
// WarnOnly records verify findings but never fails the release.
WarnOnly *bool `yaml:"warnOnly,omitempty" json:"warnOnly,omitempty"`
// EventsWindow limits how far back to consider Warning events (prevents old noisy events
// from failing new runs). Defaults to 15m when enabled.
EventsWindow *time.Duration `yaml:"eventsWindow,omitempty" json:"eventsWindow,omitempty"`
// Timeout bounds how long verify may run for this release. Defaults to 2m when enabled.
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
// DenyReasons fails when a Warning event reason matches any entry (case-insensitive).
// When empty, all Warning reasons are considered.
DenyReasons []string `yaml:"denyReasons,omitempty" json:"denyReasons,omitempty"`
// AllowReasons allows only these Warning event reasons when non-empty (case-insensitive).
AllowReasons []string `yaml:"allowReasons,omitempty" json:"allowReasons,omitempty"`
// RequireConditions enforces status.conditions on matching custom resources (CRs).
RequireConditions []VerifyConditionRequirement `yaml:"requireConditions,omitempty" json:"requireConditions,omitempty"`
}
Source Files
¶
- action_plugin_exec.go
- adaptive_concurrency.go
- apply_cache.go
- audit.go
- bundle_crypto.go
- bundle_export.go
- bundle_sign.go
- bundle_tar.go
- bundle_unpack.go
- bundle_verify.go
- cli_config.go
- compile.go
- console.go
- custom_exec.go
- dag.go
- db_program_exec.go
- deps.go
- discovery.go
- doc.go
- event_fields.go
- filter.go
- filter_status.go
- git.go
- git_identity.go
- git_map.go
- graph.go
- hash.go
- helm_exec.go
- hooks_config.go
- hooks_exec.go
- hooks_merge.go
- infer_deps.go
- input_bundle.go
- k8s_cert_exec.go
- k8s_cluster_inspect_exec.go
- k8s_cluster_verify_exec.go
- k8s_lifecycle_policy.go
- k8s_lifecycle_summary.go
- lock_owner.go
- merge.go
- node_kind.go
- node_steps.go
- plan_bundle.go
- plan_order.go
- print.go
- print_audit.go
- print_audit_html.go
- print_graph.go
- print_runs.go
- resume.go
- retry.go
- run.go
- run_artifacts.go
- run_events.go
- run_meta.go
- run_plan.go
- runner_config.go
- runs.go
- runs_types.go
- schedule_priority.go
- sealed_plan.go
- select.go
- state_sqlite.go
- status.go
- status_table.go
- types.go
- verify_kube.go