Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing options in volume's display while setting uid and gid #8793

Merged
merged 1 commit into from Dec 23, 2020

Conversation

zhangguanzhang
Copy link
Collaborator

@zhangguanzhang zhangguanzhang commented Dec 21, 2020

Fixes: #8791

$ podman   volume create testvol --opt o=uid=1001,gid=1001
testvol
$ ./bin/podman   volume create testvol2 --opt o=uid=1001,gid=1001
testvol2
$ podman volume inspect --format '{{ .Options}}' testvol 
map[]
$ podman volume inspect --format '{{ .Options}}' testvol2
map[o:uid=1001,gid=1001]

Signed-off-by: zhangguanzhang zhangguanzhang@qq.com

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zhangguanzhang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 21, 2020
@zhangguanzhang zhangguanzhang changed the title fix missing options in volume's display for uid and gid Fix missing options in volume's display for uid and gid Dec 21, 2020
@zhangguanzhang zhangguanzhang changed the title Fix missing options in volume's display for uid and gid Fix missing options in volume's display while setting uid and gid Dec 21, 2020
@zhangguanzhang
Copy link
Collaborator Author

ci failed, need re-test

@Luap99
Copy link
Member

Luap99 commented Dec 21, 2020

This would display as:

...
"Options": {
      "o": "uid=100,gid=100"
},
...

I think @sshnaidm wants

"Options": {
      "UID": 100,
      "GID": 100
},

@Luap99
Copy link
Member

Luap99 commented Dec 21, 2020

@zhangguanzhang Btw you can restart the tests if you go on the checks tab. There should be a button Re-Run for you.

@zhangguanzhang
Copy link
Collaborator Author

@zhangguanzhang Btw you can restart the tests if you go on the checks tab. There should be a button Re-Run for you.

[root@k8s-m1 ~]# docker volume create testvol --opt o=uid=1001,gid=1001 --opt type=tmpfs --opt device=tempfs 
testvol
[root@k8s-m1 ~]# docker volume inspect testvol 
[
    {
        "CreatedAt": "2020-12-21T10:58:55+08:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/testvol/_data",
        "Name": "testvol",
        "Options": {
            "device": "tempfs",
            "o": "uid=1001,gid=1001",
            "type": "tmpfs"
        },
        "Scope": "local"
    }
]

@sshnaidm
Copy link
Member

@zhangguanzhang I'd agree with @Luap99, better to have it as:

"Options": {
      "UID": 100,
      "GID": 100
},

o= is just a shortcut for option as I can understand.

thanks for working on it!

@mheon
Copy link
Member

mheon commented Dec 21, 2020

I think using UID and GID keys, instead of o=, is probably OK - the o= options are passed directly to the mount command with the local driver, these are not. Once I finish the volume plugin support in January, arbitrary options will also be supported there as well.

@zhangguanzhang
Copy link
Collaborator Author

all had done

@rhatdan
Copy link
Member

rhatdan commented Dec 22, 2020

LGTM

@baude
Copy link
Member

baude commented Dec 22, 2020

@zhangguanzhang can you please update your commit msg to be more informative? i love the examples i'm just looking for a better intro to them? then im happy to merge.

@zhangguanzhang
Copy link
Collaborator Author

I'm on the bed, I will update it at tomorrow

```
$ podman volume create testvol --opt o=uid=1001,gid=1001
$ ./bin/podman volume create testvol2 --opt o=uid=1001,gid=1001
$ podman volume inspect testvol
        "Options": {},
$ podman volume inspect testvol2
        "Options": {
            "GID": "1001",
            "UID": "1001",
            "o": "uid=1001,gid=1001"
        },
```

Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
@baude
Copy link
Member

baude commented Dec 23, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 23, 2020
@openshift-merge-robot openshift-merge-robot merged commit 0778c11 into containers:master Dec 23, 2020
@zhangguanzhang zhangguanzhang deleted the vol-op branch December 24, 2020 01:50
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report UID and GID of volumes under "Options" section in inspection
8 participants