nomad-temporal-jobs

nodecleanup-workflows

import "munchbox/temporal-workers/nodecleanup/workflows"

Index

func Cleanup

func Cleanup(ctx workflow.Context, config activities.CleanupConfig) ([]activities.CleanupResult, error)

Cleanup discovers all Nomad client nodes and performs orphaned data directory removal on each via SSH. Nodes are processed sequentially to avoid overwhelming the cluster. Returns results for all nodes and an error if any node fails.

func RegistryGC

func RegistryGC(ctx workflow.Context, config activities.RegistryGCConfig) (result activities.RegistryGCResult, err error)

RegistryGC orchestrates the saga. The named return value `err` is what the deferred scale-back compensation inspects to decide whether to log the registry-down condition loudly. The deferred scale-back ALWAYS fires once we’ve successfully scaled down — it does not gate on `err`, because Nomad’s scale endpoint is idempotent and re-issuing `count=1` when the job is already at 1 is a safe no-op on the happy path.

Generated by gomarkdoc