From 73b8a598d2f4a920710bfcec52904ce3e22f77e1 Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Fri, 10 Jan 2020 14:57:59 +0530 Subject: [PATCH] ceph: add support to create system user for createuser api Currently this is no way to create user with system permission in objectstore. Add support for the same Signed-off-by: Jiffin Tony Thottan --- pkg/operator/ceph/object/user.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/operator/ceph/object/user.go b/pkg/operator/ceph/object/user.go index b5edf4699..99b8a473f 100644 --- a/pkg/operator/ceph/object/user.go +++ b/pkg/operator/ceph/object/user.go @@ -42,6 +42,7 @@ type ObjectUser struct { Email *string `json:"email"` AccessKey *string `json:"accessKey"` SecretKey *string `json:"secretKey"` + SystemUser bool `json:"systemuser"` } // ListUsers lists the object pool users. @@ -126,6 +127,10 @@ func CreateUser(c *Context, user ObjectUser) (*ObjectUser, int, error) { args = append(args, "--email", *user.Email) } + if user.SystemUser { + args = append(args, "--system") + } + result, err := runAdminCommand(c, args...) if err != nil { if strings.Contains(result, "could not create user: unable to create user, user: ") {