setrollingstrategy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package setrollingstrategy implements the manifest.set_rolling_strategy builtin function: set a service's Argo Rollout to a rolling update strategy by editing a structured document model, never by splicing strings into manifest text.

It finds the Rollout document whose metadata.name matches the target service, then sets (or replaces) its spec.strategy with a canary strategy that has the given surge bounds and no steps — a canary with no steps behaves as a rolling update. The surge bounds are written as literal scalar nodes, so a crafted value can never alter the manifest's structure. Only the matched document is rewritten; sibling documents in the same file are preserved byte-for-byte.

The shared YAML machinery — document splitting/matching, node navigation, safe mutation, and re-serialization — lives in the manifest package; this package layers set_rolling_strategy's inputs, validation, and the rolling strategy it builds on top. The public API — Spec() and Run() — is what step-runner's builtin wrapper consumes.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWorkloadNotFound is returned when no Rollout document has a
	// metadata.name matching the target service. Fails loudly so a typo'd
	// service (or one pointed at a manifest set that doesn't contain it) can't
	// silently no-op.
	ErrWorkloadNotFound = errors.New("workload not found")

	// ErrWorkloadAmbiguous is returned when more than one Rollout document
	// matches the service name (within one file or across the file set). Setting
	// the strategy must target exactly one workload, so an ambiguous match is an
	// error.
	ErrWorkloadAmbiguous = errors.New("workload matched more than one document")
)

Functions

func New

func New() runner.BuiltinFunction

New builds the manifest.set_rolling_strategy builtin. Like manifest.pin_images it needs no token and no cluster round-tripper: it is a pure transform over the manifest text it's handed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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