Conversation
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'.
WalkthroughThis PR introduces a new snapshot state constant Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
SnapshotStatePopulatedconstant in the snapshot API - Added migration logic in the snapshot controller to automatically transition snapshots from
PopulatedtoReadystate - Updated image creation logic to accept snapshots in either
ReadyorPopulatedstate
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.
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
Bug Fixes