workflow

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAdminProjectDisoceryWorkflow

func RunAdminProjectDisoceryWorkflow(cloudName string, timeoutSeconds int, notificationTargets []notifications.NotificationTarget, logLevel string) error

func RunKubeOperatorWorkflow

func RunKubeOperatorWorkflow(
	namespace string,
	cloudName string,
	timeoutSeconds int,
	notificationTargets []notifications.NotificationTarget,
	logLevel string,
	kubeconfig string,
	incluster bool,
	requestsCPU string,
	requestsMem string,
	limitsCPU string,
	limitsMem string,
	snapsentryImage string,
) error

RunKubeOperatorWorkflow orchestrates the deployment of Snapsentry agents across multiple OpenStack projects.

It performs a discovery phase to identify subscribed projects, checks for existing Kubernetes deployments, and for any missing deployments, it automates:

  1. The creation of specialized OpenStack service users.
  2. The generation of a clouds.yaml configuration stored as a Kubernetes Secret.
  3. The rollout of a Snapsentry Deployment in the specified K8s namespace.

Returns an error if the initial OpenStack connection or Kubernetes configuration fails, but continues processing other projects if a single project deployment fails.

func RunProjectSnapshotExpiryWorkflow

func RunProjectSnapshotExpiryWorkflow(cloudName string, timeoutSeconds int, logLevel string, now time.Time, notifier *notifications.NotificationManager) error

RunProjectSnapshotExpiryWorkflow executes the retention enforcement process for a tenant.

Responsibilities:

  1. Discovery: Retrieves *all* snapshots in the project that bear the SnapSentry management tag. This is a "Sweep" operation, independent of the source volumes (which might have been deleted).
  2. Evaluation: Checks the `ExpiryDate` metadata on each snapshot against the current reference time.
  3. cleanup: Permanently deletes snapshots that have exceeded their retention period.

Parameters:

  • now: The reference time for expiry (usually time.Now(), but injected for deterministic testing. UTC).

func RunProjectSnapshotWorkflow

func RunProjectSnapshotWorkflow(cloudName string, timeoutSeconds int, notifier *notifications.NotificationManager, logLevel string) error

func SetupLogger

func SetupLogger(level string, cloudName string) *slog.Logger

setupLogger configures the application-wide logger. It uses "tint" for colorized, structured logging that is easy to read in terminals.

func SubscribeVolumeDaily

func SubscribeVolumeDaily(cloudName, logLevel, volID string, enabled bool, retention int, start, tz string) error

SubscribeVolumeDaily configures the Daily policy on a volume.

func SubscribeVolumeExpress

func SubscribeVolumeExpress(cloudName, logLevel, volID string, enabled bool, retention int, tz string, interval int) error

SubscribeVolumeDaily configures the Daily policy on a volume.

func SubscribeVolumeMonthly

func SubscribeVolumeMonthly(cloudName, logLevel, volID string, enabled bool, retention int, start, tz string, day int) error

SubscribeVolumeMonthly configures the Monthly policy on a volume.

func SubscribeVolumeWeekly

func SubscribeVolumeWeekly(cloudName, logLevel, volID string, enabled bool, retention int, start, tz, weekday string) error

SubscribeVolumeWeekly configures the Weekly policy on a volume.

Types

This section is empty.

Jump to

Keyboard shortcuts

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