Skip to content

Commit

Permalink
apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhi.li committed Oct 31, 2023
1 parent c88c6a1 commit 0103d0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/minio.min.io/v2/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ func (t *Tenant) CreateUsers(madmClnt *madmin.AdminClient, userCredentialSecrets
}

// CreateBuckets creates buckets and skips if bucket already present
func (t *Tenant) CreateBuckets(minioClient *minio.Client, buckets ...Bucket) (create bool, err error) {
func (t *Tenant) CreateBuckets(minioClient *minio.Client, buckets ...Bucket) (created bool, err error) {
createBucketCount := 0
for _, bucket := range buckets {
// create each bucket with a 20 seconds timeout
Expand Down
8 changes: 4 additions & 4 deletions pkg/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (c *Controller) createUsers(ctx context.Context, tenant *miniov2.Tenant, te
return err
}

func (c *Controller) createBuckets(ctx context.Context, tenant *miniov2.Tenant, tenantConfiguration map[string][]byte) (create bool, err error) {
func (c *Controller) createBuckets(ctx context.Context, tenant *miniov2.Tenant, tenantConfiguration map[string][]byte) (created bool, err error) {
tenantBuckets := tenant.Spec.Buckets
if len(tenantBuckets) == 0 {
return false, nil
Expand All @@ -326,20 +326,20 @@ func (c *Controller) createBuckets(ctx context.Context, tenant *miniov2.Tenant,
klog.Errorf("Error instantiating minio Client: %v ", err)
return false, err
}
create, err = tenant.CreateBuckets(minioClient, tenantBuckets...)
created, err = tenant.CreateBuckets(minioClient, tenantBuckets...)
if err != nil {
klog.V(2).Infof("Unable to create MinIO buckets: %v", err)
if _, terr := c.updateTenantStatus(ctx, tenant, StatusProvisioningDefaultBuckets, 0); terr != nil {
return false, err
}
return false, err
}
if create {
if created {
if _, err = c.updateProvisionedBucketStatus(ctx, tenant, true); err != nil {
klog.V(2).Infof(err.Error())
}
}
return create, err
return created, err
}

// getOperatorDeploymentName Internal func returns the Operator deployment name from MINIO_OPERATOR_DEPLOYMENT_NAME ENV variable or the default name
Expand Down

0 comments on commit 0103d0b

Please sign in to comment.