Repository navigation
Add opt-in named volume creation and retained-storage lifecycle tests - #413
Merged
Merged
Conversation
Signed-off-by: Ryan Cook <rcook@redhat.com>
|
Sorry @cooktheryan, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 6 days and 17 hours by commenting |
Reviewer's GuideIntroduces opt-in, non-destructive named-volume creation for raw workloads and annotation-driven PVC generation for Kubernetes workloads, while preserving existing defaults and explicit manifest settings. The PR adds comprehensive unit and Podman lifecycle coverage for creation, mounts, reuse, retention, removal, and re-addition, and documents configuration, persistence, permissions, and native systemd/Quadlet usage. Sequence diagram for opt-in named-volume lifecyclesequenceDiagram
participant Workload as Workload declaration
participant Engine
participant Podman
participant Container
Workload->>Engine: applyRawInput()
Engine->>Engine: ensureRawVolumes()
Engine->>Podman: volumes.Inspect(name)
alt volume missing
Engine->>Podman: volumes.Create(name, local, IgnoreIfExists)
else volume exists
Engine-->>Engine: reuse unchanged volume
end
Engine->>Podman: create workload with mount
Podman-->>Container: mount volume at destination
Sequence diagram for annotation-driven PVC generationsequenceDiagram
participant Manifest as Kube manifest
participant Engine
participant Podman
participant Workload as Pod or controller template
Manifest->>Engine: labelKubeManifest()
Engine->>Engine: addKubeVolumeDeclarations()
alt create-volumes is true
Engine->>Engine: collect missing persistentVolumeClaim references
Engine->>Engine: append PersistentVolumeClaim declarations
else annotation absent or false
Engine-->>Engine: preserve manifest declarations
end
Engine->>Podman: apply labeled manifest
Podman-->>Workload: mount declared PVC references
Flow diagram for retained-volume redeploymentflowchart LR
A[Opt in to volume creation] --> B{Named volume exists?}
B -->|No| C[Create volume]
B -->|Yes| D[Reuse volume unchanged]
C --> E[Deploy workload with mount]
D --> E
E --> F[Remove workload]
F --> G[Volume retained]
G --> H[Re-add workload]
H --> D
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add opt-in named-volume creation per workload declaration while retaining existing Podman behavior by default. Raw
Volumesentries acceptcreate: truealongside their existing name, destination, and mount options. Kube Pods and controller Pod templates can usefetchit.containers.io/create-volumes: "true"to generate missing PVC declarations for their own claim references. Mounts remain container-specific; existing explicit PVC options take precedence within the manifest.Existing volumes are reused without changing data or metadata, and workload removal retains volumes. This PR does not add destructive volume recreation. Systemd and Quadlet continue using their native volume creation and mount syntax, documented in the new guide.
Add native GitHub Actions coverage on Ubuntu rootful/rootless and Fedora Podman 5 for missing-volume creation, actual mount paths, retained markers on replay, retained volumes after removal, and successful re-addition. Cover raw, generated PVCs, and explicit PVCs. Unit tests cover mixed/default declarations, deduplication, malformed flags and names, inspection errors, controller templates, and SOPS preparation.
Update README, methods, release notes, and Read the Docs with flags, complete mount examples, ownership/permissions considerations, persistence, and existing systemd/Quadlet syntax.
Validation: full Go suite passed with real SOPS/age tools; focused engine tests passed after adding controller/SOPS cases; Linux integration binary compilation and vet passed; strict Sphinx build and actionlint passed. Native runtime checks run in this PR's GitHub Actions.
Related to #152. Deliberate destructive resets remain outside this change.
Summary by Sourcery
Add opt-in persistent volume provisioning for raw and Kubernetes workloads without changing existing volume lifecycle behavior by default.
New Features:
Bug Fixes:
Enhancements:
CI:
Documentation:
Tests: