red-hat-storage / ocs-ci

https://ocs-ci.readthedocs.io/en/latest/
MIT License
109 stars 166 forks source link

Split mcg_bucket into Object Bucket Claim and Object Bucket #1405

Closed fbalak closed 1 year ago

fbalak commented 4 years ago

https://github.com/red-hat-storage/ocs-ci/blob/master/ocs_ci/ocs/resources/mcg_bucket.py implements classes MCGBucket, S3Bucket, OCBucket and CLIBucket. These classes are accessing obc resources but their names indicate that they represent ob. There should be representations for Bucket and Bucket claim. Bucket should contain reference to its bucket claim object.

fbalak commented 4 years ago

@MeridianExplorer Do you think that this makes sense?

Neon-White commented 4 years ago

Hi @fbalak - thanks for bringing this up!

I believe we actually have a mixed bag over here - OCBucket and CLIBucket create an OBC, that in turn creates an OB. The objects they represent are indeed claims, and not the buckets themselves. However, S3Bucket actually represents an object bucket, since S3 is a different control plane that does not use bucket claims.

I believe a possible direction will be to change the CLI and OC buckets to point at their actual object buckets (using S3), and they'll also contain their respective claims, in a different attribute.

What do you think?

fbalak commented 4 years ago

@MeridianExplorer That would be a possible solution but I think that it would be better to have distinct representation for buckets and claims. Do you think it would make sense to have one ObjectBucketClaim class with some method parameter that takes values OC or CLI?

Also, we can have ObjectBucket objects with link to ObjectBucketClaim object that was used to create them and work with them separately so there will be no confusion for user about what resource is currently used.

Neon-White commented 4 years ago

@fbalak - OBC was implemented in March -

https://github.com/red-hat-storage/ocs-ci/blob/bdb4fce13b5582df09afef9028665554151fb307/ocs_ci/ocs/resources/bucket_policy.py#L14-L17

Considering we do not interact with OBs directly - I personally think it's sufficient. What do you think?

fbalak commented 4 years ago

If we don't interact with OBs directly then it's probably ok to close it but we should make sure that correct terminology is used everywhere (claims are not referenced as buckets).

Neon-White commented 4 years ago

I agree with your point that the terminology is problematic - but refactoring all our code to treat OBCs as OBCs instead of buckets will be a pretty heavy undertaking right now. Maybe we can add some text regarding those terminologies somewhere in OCSCI?

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs.

github-actions[bot] commented 1 year ago

This issue has been automatically closed due to inactivity. Please re-open if this still requires investigation.