sodafoundation / api

SODA Terra Project API module : is an open source implementation of SODA API connecting storage to platforms like Kubernetes, OpenStack, and VMware
Apache License 2.0
828 stars 316 forks source link

Missing cli for create fileshare acl #921

Open Shruthi-1MN opened 5 years ago

Shruthi-1MN commented 5 years ago

Is this a BUG REPORT or FEATURE REQUEST?: Acl of fileshare from cli is not able to update

Uncomment only one, leave it on its own line:

/kind bug /kind feature

What happened: I tried to set Acl for fileshare using cli, i see the acl list is empty

What you expected to happen: It should set ACL and when we list in acl, it should show the permissions. But list is empty.

How to reproduce it (as minimally and precisely as possible): Create file share

root@shruthi-VirtualBox:~/go/src/github.com/opensds/opensds# osdsctl fileshare create 1 -n "fileshare23"
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| Id               | c85223fc-d118-4a50-87f7-f66e9f33c96d |
| CreatedAt        | 2019-06-21T13:35:51                  |
| TenantId         | e93b4c0934da416eb9c8d120c5d04d96     |
| UserId           |                                      |
| Name             | fileshare23                          |
| Protocols        | []                                   |
| Description      |                                      |
| Size             | 1                                    |
| AvailabilityZone | default                              |
| Status           | creating                             |
| PoolId           |                                      |
| ProfileId        | beb40491-72a5-4025-a48a-6eae54a4fd78 |
| SnapshotId       |                                      |
| ExportLocations  | []                                   |
| Metadata         | null                                 |
|                  |                                      |
+------------------+--------------------------------------+

When the fileshare is available

root@shruthi-VirtualBox:~/go/src/github.com/opensds/opensds# osdsctl fileshare show c85223fc-d118-4a50-87f7-f66e9f33c96d
+------------------+-------------------------------------------------------------+
| Property         | Value                                                       |
+------------------+-------------------------------------------------------------+
| Id               | c85223fc-d118-4a50-87f7-f66e9f33c96d                        |
| CreatedAt        | 2019-06-21T13:35:51                                         |
| UpdatedAt        | 2019-06-21T13:35:51                                         |
| TenantId         | e93b4c0934da416eb9c8d120c5d04d96                            |
| UserId           |                                                             |
| Name             | fileshare23                                                 |
| Protocols        | [nfs]                                                       |
| Description      |                                                             |
| Size             | 1                                                           |
| AvailabilityZone | default                                                     |
| Status           | available                                                   |
| PoolId           | 898fbdc5-d3b9-5016-aab1-3326f17c8b20                        |
| ProfileId        | beb40491-72a5-4025-a48a-6eae54a4fd78                        |
| SnapshotId       |                                                             |
| ExportLocations  | [11.245.100.105:/var/fileshare23]                           |
| Metadata         | {                                                           |
|                  |   "lvPath": "/dev/opensds-files-default/fileshare23",       |
|                  |   "nfsFileshareID": "c85223fc-d118-4a50-87f7-f66e9f33c96d", |
|                  |   "nfsFileshareName": "fileshare23"                         |
|                  | }                                                           |
|                  |                                                             |
+------------------+-------------------------------------------------------------+

Create ACL foe existing fileshare to set the permission for client ip

osdsctl fileshare acl create c85223fc-d118-4a50-87f7-f66e9f33c96d -a "10.30.102.1" -c "["Read","Write"]" -t "ip"

Results is empty

root@shruthi-VirtualBox:~/go/src/github.com/opensds/opensds# osdsctl fileshare acl list
+----+-------------+------+------------------+----------+-------------+
| Id | FileShareId | Type | AccessCapability | AccessTo | Description |
+----+-------------+------+------------------+----------+-------------+
+----+-------------+------+------------------+----------+-------------+

In osdsapiserver log i.e /var/log/opensds/osdsapiserver.INFO i don't see POST call for acl, so cli is not requesting to create acl, below is the log

Log file created at: 2019/06/21 13:34:31 Running on machine: shruthi-VirtualBox Binary: Built with gc go1.11.2 for linux/amd64 Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg I0621 13:34:31.767053 29197 logs.go:75] [Info] LogFlushFrequency: 5s I0621 13:34:31.783255 29197 auth.go:48] noauth I0621 13:34:31.783260 29197 auth.go:57] &{} I0621 13:34:31.991678 29197 accesslog.go:26] ^[[32m[D] 127.0.0.1:55714 -- GET /^[[0m I0621 13:34:32.036964 29197 accesslog.go:26] ^[[32m[D] 127.0.0.1:55720 -- POST /v1beta/e93b4c0934da416eb9c8d120c5d04d96/profiles^[[0m I0621 13:34:32.070066 29197 accesslog.go:26] ^[[32m[D] 127.0.0.1:55722 -- POST /v1beta/e93b4c0934da416eb9c8d120c5d04d96/profiles^[[0m I0621 13:35:51.260190 29197 accesslog.go:26] ^[[32m[D] 127.0.0.1:55724 -- POST /v1beta/e93b4c0934da416eb9c8d120c5d04d96/file/shares^[[0m W0621 13:35:51.260287 29197 fileshare.go:172] Use default profile when user doesn't specify profile. W0621 13:35:51.261186 29197 db.go:135] Use default availability zone when user doesn't specify availabilityZone. I0621 13:37:21.001513 29197 accesslog.go:26] ^[[32m[D] 127.0.0.1:55730 -- GET /v1beta/e93b4c0934da416eb9c8d120c5d04d96/file/acls^[[0m I0621 13:39:00.850452 29197 accesslog.go:26] ^[[32m[D] 127.0.0.1:55732 -- GET /v1beta/e93b4c0934da416eb9c8d120c5d04d96/file/acls^[[0m I0621 13:44:00.161576 29197 accesslog.go:26] ^[[32m[D] 127.0.0.1:55734 -- GET /v1beta/e93b4c0934da416eb9c8d120c5d04d96/file/shares/c85223fc-d118-4a50-87f7-f66e9f33c96d^[[0m

Anything else we need to know?:

Environment:

leonwanghui commented 5 years ago

/assign @BaiHuoYu

satya-gorli commented 5 years ago

/assign @BaiHuoYu Please fix this issue asap as its an important feature