feat(api): add RecoverySpec and backup compression fields to CRD - #12
Merged
Conversation
- Add RecoverySpec for point-in-time recovery (PITR) support - serverName, targetTime, destinationPath, endpointURL, s3CredentialsSecret - Add compression fields to BackupSpec (walCompression, dataCompression) - Supports gzip, bzip2, snappy, none - Add ConditionTypeBackupReady status condition - Add CEL validation: backup and recovery cannot both be enabled - Add plugin-barman-cloud dependency for ObjectStore types - Register barmancloudv1 scheme in main.go - Upgrade CNPG to v1.28.0 Part of #7
…r reconciliation - Add objectstore.go with BuildObjectStore() and BuildRecoveryObjectStore() - Add scheduled_backup.go with BuildScheduledBackup() - Extend cluster.go with buildBootstrapConfiguration() for recovery bootstrap - Add external clusters configuration for PITR recovery - Add reconcileBackupInfrastructure() to controller - Add RBAC permissions for objectstores and scheduledbackups - Register barmancloudv1 types in SetupWithManager Part of #7
Contributor
Author
|
PR Review Summary Critical Issues (2 found)
Important Issues (4 found)
Suggestions (5 found)
Strengths
Recommended Action
|
- Move backup infrastructure reconciliation before cluster creation (Phase 2.5 instead of 3.5) to avoid race condition where Cluster references ObjectStore before it exists - Remove silent nil checks - now explicitly error when builders return nil unexpectedly when backup/recovery is enabled - Add status updates after setting BackupReady condition on all error paths for user visibility - Extract createOrUpdateObjectStore and createOrUpdateScheduledBackup helper functions to reduce code duplication
Contributor
Author
Fix Status UpdateAll critical and important issues have been addressed in commit a72dcf5: Critical Issues ✅
Important Issues ✅
Suggestions (deferred)
|
- Define CompressionType alias for type safety with enum constants - Extract S3Config embedded type to reduce duplication between BackupSpec and RecoverySpec - Add RFC 3339 pattern validation for TargetTime field - Add S3 path pattern validation for DestinationPath field - Refactor reconcileBackupInfrastructure using guard statements: split into reconcileBackup, reconcileRecovery, and failBackup helper
Contributor
Author
Suggestions Status UpdateAll 5 suggestions from the PR review have been implemented in commit 13f94eb:
All critical issues, important issues, and suggestions are now complete. |
Contributor
Author
|
Remain Issues:
Minor (acceptable)
|
- Add ConditionTypeRecoveryReady for recovery infrastructure status - Add status condition updates to reconcileRecovery (was missing) - Add failRecovery helper for consistent error handling - Add validateS3Secret to verify credentials secret exists with required keys (ACCESS_KEY_ID, SECRET_ACCESS_KEY) before creating ObjectStore resources - Apply S3 validation to both backup and recovery paths
Contributor
Author
Additional Fixes (648e2fb)Two critical issues identified in second review have been fixed:
S3 Secret ValidationBefore creating ObjectStore, now validates:
Users will see clear error in status condition if S3 secret is missing or invalid. |
- Add cleanupBackupResources to delete ObjectStore/ScheduledBackup when disabled - Add cleanupRecoveryResources to delete recovery ObjectStore when disabled - Skip cleanup if feature was never configured (check condition existence) - Remove unreachable nil checks after builder guard clauses
Contributor
Author
|
Additional fixes in 8c15c1e:
|
- Split into pr.yaml (PR checks) and ci.yaml (main push) - pr.yaml: lint, test, build, check generated manifests - ci.yaml: lint, test, build, auto-sync CRDs to Helm chart, docker push - Pin golangci-lint to v2.6 with action v9 - Remove stale BackupReady/RecoveryReady conditions on cleanup
Contributor
Author
|
Latest fixes in cc55f8c: Workflow refactor:
Controller fix:
|
9 tasks
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.
Summary
RecoverySpecfor point-in-time recovery (PITR) from existing backupswalCompression,dataCompression) toBackupSpecConditionTypeBackupReadystatus conditionplugin-barman-clouddependency forObjectStoretypesNew CRD Fields
Validation Rules
serverName,destinationPath,s3CredentialsSecretPart of #7