drift

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package drift decides whether an application matches git.

Phase 1 implements one mode, driftDetection: manifest. Diffing the desired ServiceSpec against the running one is Phase 2 and answers a different question — this one compares what the repository renders to against what was last applied, which catches a changed chart version, changed values and a changed template, but not an operator running `docker service update` behind the controller's back.

The whole decision comes out of the chart engine's plan. The engine already canonicalises values through a YAML round trip and compares the rendered manifest string, so asking it to plan is exactly as authoritative as its own apply — and it is the same work the sync would do, rather than an approximation of it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diffs

func Diffs(plan *charts.Plan) []application.ReleaseDiff

Diffs renders the manifest change each release would undergo.

Unchanged releases are omitted: their diff is empty by construction, and a response listing them would make a synced application look like it had twenty things to say.

The rendering is the chart engine's own (utils/textdiff), so what the API serves is character-for-character what `swarmcli charts apply --diff` prints. Two renderings of the same change that disagree in whitespace would be worse than either alone.

func FromPlan

func FromPlan(plan *charts.Plan) (application.Sync, []application.ReleaseStatus)

FromPlan maps a plan to an application's sync status and its per-release detail.

The returned Sync carries no Revision and no LastSync: a plan does not know which commit produced it, or what happened the last time one was applied. The reconciler fills both. ReleaseStatus.Revision is likewise left zero — the chart revision number lives in the release records, not in the plan.

Plan.Orphaned and Plan.Unmanaged are deliberately not surfaced. They now classify against this controller's own owner id rather than the command line's (Eldara-Tech/swarmcli#499, adopted in #27), so they are at least about the right releases — but they answer a per-swarm question, not a per-application one: with several applications on one swarm, each would report the others' releases as unmanaged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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