Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create buckets upon tenant creation or after tenant creation #1783

Merged
merged 1 commit into from
Oct 14, 2023

Conversation

cniackz
Copy link
Contributor

@cniackz cniackz commented Sep 20, 2023

Fixes : #1783

Objective:

To be able to create a bucket after the tenant is created.

Reasoning:

We have customers who wants to create buckets once tenant is created by just changing GitOps Tenant Spec YAML. This will save them time as they will not need to create additional Jobs or containers to add buckets and all is needed is to change the tenant spec in their GitOps/ArgoCD flow.

Testing:

image

By doing this, we can keep creating as many buckets as needed after tenant is deployed. And we are protected against any failure because we have the code already in place to detect when bucket is created:

  • File: operator/pkg/apis/minio.min.io/v2/helper.go
		}); err != nil {
			switch minio.ToErrorResponse(err).Code {
			case "BucketAlreadyOwnedByYou", "BucketAlreadyExists":
				klog.Infof(err.Error())
				continue

As a result we get in the logs:

I0919 20:21:59.241643   81813 helper.go:779] Your previous request to create the named bucket succeeded and you already own it.

Question is:

  • If this is not approved, why we want to create bucket just upon tenant creation?: add bucket upon tenant creation #820

  • If we can create buckets on the fly, should we do it? what is the advantage or disadvantage of not doing it?. Please let's discuss this internally for me to understand better the reasons behind 820 PR.

@cniackz cniackz self-assigned this Sep 20, 2023
@cniackz cniackz added the enhancement New feature or request label Sep 20, 2023
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@jiuker jiuker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Should we mark this field as discarded? @cniackz

@cniackz cniackz merged commit 8338ac6 into minio:master Oct 14, 2023
24 checks passed
@cniackz cniackz deleted the bucket-on-tenant-creation-1 branch October 14, 2023 13:18
@cniackz
Copy link
Contributor Author

cniackz commented Oct 14, 2023

@jiuker what do you mean by field as discarded?....
I merged this PR because it got approved by 3 people
And the change should be harmless
So no, let's no discard this changed but keep it and if it affects somehow, we can revert it.

@allanrogerr
Copy link
Contributor

fixes #1346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants