Set up S3 testing infrastructure for backup implementation
- Add gofakes3 for in-process S3-compatible test server - Create test server that runs on localhost:9999 with temp directory - Implement basic S3 client wrapper with standard operations - Add comprehensive tests for blob and metadata storage patterns - Test cleanup properly removes temporary directories - Use AWS SDK v2 for S3 operations with proper error handling
This commit is contained in:
@@ -37,7 +37,7 @@ func snapshotListCmd() *cobra.Command {
|
||||
cmd.Flags().StringVar(&bucket, "bucket", "", "S3 bucket name")
|
||||
cmd.Flags().StringVar(&prefix, "prefix", "", "S3 prefix")
|
||||
cmd.Flags().IntVar(&limit, "limit", 10, "Maximum number of snapshots to list")
|
||||
cmd.MarkFlagRequired("bucket")
|
||||
_ = cmd.MarkFlagRequired("bucket")
|
||||
|
||||
return cmd
|
||||
}
|
||||
@@ -61,8 +61,8 @@ func snapshotRmCmd() *cobra.Command {
|
||||
cmd.Flags().StringVar(&bucket, "bucket", "", "S3 bucket name")
|
||||
cmd.Flags().StringVar(&prefix, "prefix", "", "S3 prefix")
|
||||
cmd.Flags().StringVar(&snapshot, "snapshot", "", "Snapshot ID to remove")
|
||||
cmd.MarkFlagRequired("bucket")
|
||||
cmd.MarkFlagRequired("snapshot")
|
||||
_ = cmd.MarkFlagRequired("bucket")
|
||||
_ = cmd.MarkFlagRequired("snapshot")
|
||||
|
||||
return cmd
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func snapshotLatestCmd() *cobra.Command {
|
||||
|
||||
cmd.Flags().StringVar(&bucket, "bucket", "", "S3 bucket name")
|
||||
cmd.Flags().StringVar(&prefix, "prefix", "", "S3 prefix")
|
||||
cmd.MarkFlagRequired("bucket")
|
||||
_ = cmd.MarkFlagRequired("bucket")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user