Documentation
¶
Overview ¶
Package argopromote implements the argo.promote builtin function: advance an Argo Rollout past one canary pause point, idempotently. Runs in-process inside kas; callers construct it with a K8sRoundTripperFactory. In production that factory routes to the tenant cluster's apiserver through agentk; argo.promote turns its http.RoundTripper into a dynamic Kubernetes client internally.
The deploy driver gates every canary traffic increment with an indefinite pause: {} step, so the Argo controller never self-advances — the flow clears each gate by calling argo.promote once per pause point. AutoFlow delivers at-least-once, so the call must be safe to replay.
The client sends a single conditional JSON Patch whose `test` ops assert the Rollout is parked at exactly this gate before clearing the pause. Any other state (already promoted, not yet at the gate, or re-paused at a different gate) fails a `test` and the apiserver applies nothing — no read-then-write race, no clobbering a pause the operator never approved. A failed precondition (HTTP 422) is currently surfaced as an error rather than treated as an idempotent replay no-op; deciding which 422s are safe to swallow is deferred until the Function runs against a real controller in the integration test (gitlab-org/ci-cd/runner-tools/argo-rollout#58). See gitlab-org/gitlab#600982.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(newRoundTripper apifunc.K8sRoundTripperFactory) runner.BuiltinFunction
New returns a runner.BuiltinFunction whose Run method obtains its Kubernetes client through newRoundTripper.
Types ¶
This section is empty.