Skip to content

New Kanister functions (Long running PVC): KubeTaskWithBackupPVC + KubeTaskWithRestorePVC - #4085

Open
anand-veeam wants to merge 6 commits into
masterfrom
anand-veeam/K10-36518-new-long-running-function
Open

anand-veeam wants to merge 6 commits into
masterfrom
anand-veeam/K10-36518-new-long-running-function

Conversation

@anand-veeam

@anand-veeam anand-veeam commented Jun 12, 2026 •

Copy link
Copy Markdown

Change Overview

Add KubeTaskWithBackupPVC and KubeTaskWithRestorePVC functions

Two new Kanister functions for the long-running-PVC backup/restore pattern (logical dump → CSI snapshot → cleanup). One phase per direction. Collapses the mongoce-style multi-phase pattern (PVC create → pod create → wait → exec → snapshot → cleanup) into a single function call per direction.

Backup — provisions staging PVC, runs user command, takes CSI snapshot (via the existing createCSISnapshot helper), waits for readyToUse=true, deletes the PVC. Outputs pvcName, volumeSnapshotName, restoreSize, snapshotContent, snapshotHandle.

Restore — resolves staging PVC via volumeSnapshotName / sourcePVCName / pvcSelector (first match wins), mounts at /restore, runs user command, deletes the PVC. Uses restoreCSISnapshot helper to materialize the PVC from the snapshot.

Supports three K10 wiring patterns from the same codebase via the takeSnapshot toggle:

actions.backup / actions.restore (recommended; function owns snapshot)
BlueprintBinding hooks (backupPrehook / restorePosthook; K10 owns snapshot)
Policy ActionHooks (K10 owns snapshot)
CSI-driver-agnostic at the API layer (works with kopia-backup, Azure Disk, AWS EBS, OpenEBS, etc.). Default storage class is kopia-backup; user-overridable.

Scope: changes confined to pkg/function/. No modifications to pkg/consts, pkg/controller, or pkg/kube.

Tests: go test ./pkg/function/ -run KubeTaskWith -count=1 → PASS

E2E validation: tested end-to-end against backup-csi-driver on AKS with Postgres and MongoDB across all three wiring patterns.
Here is doc for this function : https://kasten.atlassian.net/wiki/spaces/EN/pages/4495474776/New+Kanister+function+Long+running+PVC+DumpVolume

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test
  • 🏗️ Build

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@anand-veeam anand-veeam changed the title Anand veeam/k10 36518 new long running function New Kanister functions (Long running PVC): KubeTaskWithBackupPVC + KubeTaskWithRestorePVC Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR is marked as stale due to inactivity. Add a new comment to reactivate it. CC @kanisterio/maintainers

@github-actions github-actions Bot added the stale label Sep 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant