Repository: minio/minio (language: go)

Issue:
Cannot declarative users create, credentials file is invalid
Im trying to create users over helm chart, and get this error

```
job/argo-stack-minio-make-user-job po/argo-stack-minio-make-user-job-kqlrq container/minio-mc logs
  Connecting to MinIO server: http://argo-stack-minio:9000
  Added `myminio` successfully.
  credentials file is invalid
```
My values file:
```
users:
  - accessKey: workflows
    existingSecret: minio-admin-user
    existingSecretKey: workflowsSecretKey
    policy: argo-workflows-policy
```

My secret:
```
kind: Secret
apiVersion: v1
metadata:
  name: minio-admin-user
  namespace: argo-stack
data:
  rootPassword: NmY3WFU2UktoS1BiNjJvRA==
  rootUser: YWRtaW4=
  workflowsAccessKey: d29ya2Zsb3dzLWFkbWlu
  workflowsSecretKey: Znh2NTk2WE1uR2lLNkxlSw==
type: Opaque
```

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used: RELEASE.2022-08-02T23-59-16Z
* Helm chart verssion: 4.0.10



Discussion / hints:
@CRASH-Tech if you need advanced functionalities use our Operator allows for creating users in a declarative way.  If you want our vanilla helm charts to do that - please send PR we shall accept it happily. 

Thank you
> @CRASH-Tech if you need advanced functionalities use our Operator allows for creating users in a declarative way. If you want our vanilla helm charts to do that - please send PR we shall accept it happily.
> 
> Thank you

Thanks, but this is a bug in the current functionality
I have the same issue. The job is failing because of `credentials file is invalid`.

```
jsafarik@s01:~$ k logs minio-make-user-job-2v6jq
Connecting to MinIO server: https://minio:9000
Added `myminio` successfully.
credentials file is invalid
```

Fix patch:
diff --git a/helm/minio/templates/_helper_create_user.txt b/helm/minio/templates/_helper_create_user.txt
index ae070ca47233a..ea2b3b675c6e3 100644
--- a/helm/minio/templates/_helper_create_user.txt
+++ b/helm/minio/templates/_helper_create_user.txt
@@ -94,6 +94,8 @@ connectToMinio $scheme
 echo {{ tpl .accessKey $global }} > $MINIO_ACCESSKEY_SECRETKEY_TMP
 {{- if .existingSecret }}
 cat /config/secrets/{{ tpl .existingSecretKey $global }} >> $MINIO_ACCESSKEY_SECRETKEY_TMP
+# Add a new line if it doesn't exist
+sed -i '$a\' $MINIO_ACCESSKEY_SECRETKEY_TMP
 createUser {{ .policy }}
 {{ else }}
 echo {{ .secretKey }} >> $MINIO_ACCESSKEY_SECRETKEY_TMP


Test patch: