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:
1 parent
ab607075da
commit
73b8a598d2
1 file changed
+5
@@ -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: ") {
|
||||
|
||||
Reference in new issue
Block a user