From 0103d0b2d8505dc76a65fa12eca03e8f0616e28f Mon Sep 17 00:00:00 2001 From: "guozhi.li" Date: Tue, 31 Oct 2023 18:52:53 +0800 Subject: [PATCH] apply suggestion --- pkg/apis/minio.min.io/v2/helper.go | 2 +- pkg/controller/operator.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/apis/minio.min.io/v2/helper.go b/pkg/apis/minio.min.io/v2/helper.go index e0233d96aa8..5c7353b8d2f 100644 --- a/pkg/apis/minio.min.io/v2/helper.go +++ b/pkg/apis/minio.min.io/v2/helper.go @@ -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 diff --git a/pkg/controller/operator.go b/pkg/controller/operator.go index be82fb45f23..628d10c0981 100644 --- a/pkg/controller/operator.go +++ b/pkg/controller/operator.go @@ -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 @@ -326,7 +326,7 @@ 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 { @@ -334,12 +334,12 @@ func (c *Controller) createBuckets(ctx context.Context, tenant *miniov2.Tenant, } 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