mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-01-11 22:39:31 +00:00
cephfs: use userid and keys for provisioning
This patch modifies the code to use userID and userKey for provisioning of both static and dynamic PVs. In case user credentials are not found admin credentials are used as a fallback and for backwards compatibility. Signed-off-by: Niraj Yadav <niryadav@redhat.com>
This commit is contained in:
parent
54a8b50957
commit
e96404b297
@ -20,6 +20,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util/log"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -110,6 +112,12 @@ func NewUserCredentials(secrets map[string]string) (*Credentials, error) {
|
||||
|
||||
// NewAdminCredentials creates new admin credentials from secret.
|
||||
func NewAdminCredentials(secrets map[string]string) (*Credentials, error) {
|
||||
// Use userID and userKey if found else fallback to adminID and adminKey
|
||||
if cred, err := newCredentialsFromSecret(credUserID, credUserKey, secrets); err == nil {
|
||||
return cred, nil
|
||||
}
|
||||
log.WarningLogMsg("adminID and adminKey are deprecated, please use userID and userKey instead")
|
||||
|
||||
return newCredentialsFromSecret(credAdminID, credAdminKey, secrets)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user