Skip to content

Reintroduce snapshot state 'Populated'#830

Merged
afritzler merged 1 commit intomainfrom
fix-snap-populated
Feb 6, 2026
Merged

Reintroduce snapshot state 'Populated'#830
afritzler merged 1 commit intomainfrom
fix-snap-populated

Conversation

@gonzolino
Copy link
Contributor

@gonzolino gonzolino commented Feb 6, 2026

Proposed Changes

The snapshot state 'Populated' was replaced with 'Ready' in commit
1f839f4. However, logic to handle old snapshots still in state
'Populated' was left out.

This commit adds the state 'Populated' back and adds logic to transfer
snapshots in state 'Populated' to 'Ready'.

Summary by CodeRabbit

  • New Features

    • Introduced new snapshot state option for expanded state management capabilities.
  • Bug Fixes

    • Enhanced snapshot readiness validation for improved image creation compatibility.
    • Improved snapshot state transitions and normalization for consistent state handling.

The snapshot state 'Populated' was replaced with 'Ready' in commit
`1f839f4`. However, logic to handle old snapshots still in state
'Populated' was left out.

This commit adds the state 'Populated' back and adds logic to transfer
snapshots in state 'Populated' to 'Ready'.
@gonzolino gonzolino requested a review from a team as a code owner February 6, 2026 13:18
Copilot AI review requested due to automatic review settings February 6, 2026 13:18
@github-actions github-actions bot added the size/S label Feb 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

This PR introduces a new snapshot state constant SnapshotStatePopulated and updates snapshot and image controller logic to handle this state, treating it as valid for cloning operations and transitioning it to the Ready state during reconciliation.

Changes

Cohort / File(s) Summary
Snapshot State Definition
api/snapshot.go
Added new exported constant SnapshotStatePopulated with value "Populated" to the SnapshotState type, expanding the set of valid snapshot states.
Image Controller
internal/controllers/image_controller.go
Updated snapshot readiness check in createImageFromSnapshot to accept both SnapshotStateReady and SnapshotStatePopulated as valid states for cloning operations.
Snapshot Controller
internal/controllers/snapshot_controller.go
Added state transition logic in reconcileSnapshot to detect when snapshot is in SnapshotStatePopulated state, transition it to SnapshotStateReady, and persist the change before continuing reconciliation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: reintroducing the snapshot state 'Populated' that was previously removed.
Description check ✅ Passed The description covers the main changes and context but does not include a 'Fixes #' reference as shown in the template, and lacks bullet points under 'Proposed Changes'.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-snap-populated

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reintroduces the SnapshotStatePopulated enum value that was previously removed in commit 1f839f4, and adds migration logic to transition existing snapshots from the Populated state to the Ready state. This addresses backward compatibility issues with snapshots that were created before the state was renamed.

Changes:

  • Reintroduced SnapshotStatePopulated constant in the snapshot API
  • Added migration logic in the snapshot controller to automatically transition snapshots from Populated to Ready state
  • Updated image creation logic to accept snapshots in either Ready or Populated state

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
api/snapshot.go Adds back the SnapshotStatePopulated constant between Pending and Ready states
internal/controllers/snapshot_controller.go Implements migration logic to detect snapshots in Populated state and update them to Ready state
internal/controllers/image_controller.go Updates the snapshot state check to accept both Ready and Populated states when creating images from snapshots

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gonzolino gonzolino added bug Something isn't working ok-to-image labels Feb 6, 2026
@afritzler afritzler merged commit 7873bd3 into main Feb 6, 2026
24 checks passed
@afritzler afritzler deleted the fix-snap-populated branch February 6, 2026 14:02
@github-project-automation github-project-automation bot moved this to Done in Storage Feb 6, 2026
@hardikdr hardikdr added the area/storage Storage solutions and related concerns. label Feb 7, 2026
@hardikdr hardikdr added this to Roadmap Feb 7, 2026
@github-project-automation github-project-automation bot moved this to Done in Roadmap Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage Storage solutions and related concerns. bug Something isn't working integration-tests ok-to-image size/S

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants