Bug #36265
rgw: list bucket can not show the object uploaded by RGWPostObj when enable bucket versioning
0%
Description
when bucket enable versioning and we upload object by post object
the post object script
```
#!/usr/bin/python
from boto3.session import Session
import boto3
import botocore
botocore.session.Session().set_debug_logger()
bucketname = 'test2'
objectname = 'prefix/keyv6'
access_key = "yly"
secret_key = "yly"
url = "http://127.0.0.1:7484"
session = Session(access_key, secret_key)
s3_client = session.client(
's3',
endpoint_url=url,
use_ssl = False,
)
#import ipdb; ipdb.set_trace() # BREAKPOINT
conditions = [
["starts-with", "$Content-Type", "image/"],
["starts-with", "$key", "prefix/"],
["content-length-range", 0, 20000000],
]
form_data = s3_client.generate_presigned_post(
Conditions = conditions,
Bucket = bucketname,
Key=objectname
)
form_data["fields"]['Content-Type'] = 'image/png'
form_data["fields"]['key'] = objectname
files = {"file": open('5M','rb')}
import requests
import logging
from requests_toolbelt.utils import dump
logging.basicConfig(level=logging.DEBUG)
response = requests.post(form_data["url"], data=form_data["fields"], files=files)
data = dump.dump_all(response)
print(data.decode('utf-8'))
```
after upload ,we can not see the object by
```
s3cmd ls s3://test2
```
Related issues
History
#1 Updated by joke lee over 5 years ago
#2 Updated by Casey Bodley over 5 years ago
- Status changed from New to 7
#3 Updated by Nathan Cutler over 5 years ago
- Status changed from 7 to Pending Backport
- Backport set to mimic, luminous
#6 Updated by Nathan Cutler over 5 years ago
- Copied to Backport #36423: luminous: rgw: list bucket can not show the object uploaded by RGWPostObj when enable bucket versioning added
#7 Updated by Nathan Cutler over 5 years ago
- Copied to Backport #36424: mimic:rgw: list bucket can not show the object uploaded by RGWPostObj when enable bucket versioning added
#8 Updated by Nathan Cutler over 5 years ago
- Status changed from Pending Backport to Resolved