current

package
v1.78.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package current runs the working revision of one package: its configuration, hooks and release. Start with next.go (every rule of Current), then loop.go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OutputOf

func OutputOf(obj model.Package) string

OutputOf is the checksum of obj's image digests, which Global publishes for every render; empty for an object without digests. It changes only with a revision that ships other images.

Types

type Config

type Config struct {
	Name     string
	Kind     model.Kind
	Revision model.Revision // Revision is the revision to run; the package Reconciler owns its image.
	// Restored: started from a settings checkpoint, so the package has run (state.ran).
	Restored bool
}

Config is what the package Reconciler passes to Start.

type Deps

type Deps struct {
	Scheduler        publisher
	Nelm             nelmService
	Hooks            hookLanes
	Orphans          orphanPurger
	ModulesNamespace string
	Metrics          metrics.PackageGauges // Metrics records the init_hooks phase; nil records none.
	Clock            retry.Clock           // Clock nil means the wall clock.
	Logger           *log.Logger           // Logger nil means a no-op logger.
}

Deps are the effects of every Current; shared by all of them and safe for concurrent use.

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler is Current: it runs one loaded revision, publishes only its own facts and writes only the Current section. The loop owns all state and decides with next; one operation at a time runs in a worker the loop starts and cancels, because an upgrade can take minutes and a new configuration, a disable, Stop or Uninstall must cancel it.

A disabled package keeps its Current: a module's decision is computed on its node, which must stay in the graph. A disabled package still accepts configurations: the enabled script reads its settings from the object.

func Start

func Start(ctx context.Context, cfg Config, deps Deps, reporter reportWriter) *Reconciler

Start starts the loop without a configuration; the package Reconciler pushes one when it has one. The first run waits for an accepted configuration and an event that echoes it. Non-blocking.

func (*Reconciler) Push

func (r *Reconciler) Push(config *model.Configuration, checksum string, ev *schedule.Event)

Push records the latest configuration with its configstate.Key, and the latest event; nil leaves that input as it is. The caller computes the checksum once per configuration: Push runs on every wake of the package Reconciler. Non-blocking.

func (*Reconciler) Revision

func (r *Reconciler) Revision() model.Revision

Revision returns the running revision.

func (*Reconciler) Stop

func (r *Reconciler) Stop()

Stop cancels the operation in progress, stops the hooks and waits for the loop to exit, so a stopped Current never writes again. It keeps the release and the image. Nil-safe.

func (*Reconciler) Uninstall

func (r *Reconciler) Uninstall(ctx context.Context) error

Uninstall retries until it succeeds; an error only when ctx is cancelled. It reads no event: the uninstall wins over everything (next, rule 1). The loop has exited when it returns; the image stays attached. Nil-safe.

Jump to

Keyboard shortcuts

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