test(e2e): require exact object lock errors (#6532)

This commit is contained in:
Zhengchao An
2026-08-24 22:08:07 +08:00
committed by GitHub
parent c80d970d58
commit 7a7871ca67
2 changed files with 98 additions and 61 deletions
+3 -1
View File
@@ -21,6 +21,8 @@
//! - Bypass governance retention header handling
use aws_sdk_s3::Client;
use aws_sdk_s3::error::SdkError;
use aws_sdk_s3::operation::delete_object::DeleteObjectError;
use aws_sdk_s3::primitives::ByteStream;
use aws_sdk_s3::types::{
DefaultRetention, ObjectLockConfiguration, ObjectLockEnabled, ObjectLockLegalHold, ObjectLockLegalHoldStatus, ObjectLockMode,
@@ -236,7 +238,7 @@ pub async fn delete_object_with_bypass(
key: &str,
version_id: Option<&str>,
bypass_governance: bool,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
) -> Result<(), SdkError<DeleteObjectError>> {
let mut request = client
.delete_object()
.bucket(bucket)