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 <jthottan@redhat.com>
This commit is contained in:
Jiffin Tony Thottan authored and Jiffin Tony Thottan committed 2020-08-03 10:24:42 +05:30
1 parent ab607075da
commit 73b8a598d2
1 file changed
+5
+5
View File
@@ -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: ") {