summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-30 12:01:40 -0400
committerGitHub <noreply@github.com>2020-06-30 12:01:40 -0400
commitc2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca (patch)
treedd7389bb37563a5636f34b3cf41f1cb2e37f2122 /pkg/domain
parent83bde3bdaf7f7b24f9ad794154207a95e7747f28 (diff)
parentce74c20ebc07ea541b7cdccd272e34c0336ffbc3 (diff)
downloadpodman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.tar.gz
podman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.tar.bz2
podman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.zip
Merge pull request #6747 from giuseppe/fix-user-volumes
container: move volume chown after spec generation
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/abi/volumes.go26
1 files changed, 22 insertions, 4 deletions
diff --git a/pkg/domain/infra/abi/volumes.go b/pkg/domain/infra/abi/volumes.go
index 702e11003..36847dd79 100644
--- a/pkg/domain/infra/abi/volumes.go
+++ b/pkg/domain/infra/abi/volumes.go
@@ -95,6 +95,15 @@ func (ic *ContainerEngine) VolumeInspect(ctx context.Context, namesOrIds []strin
}
reports := make([]*entities.VolumeInspectReport, 0, len(vols))
for _, v := range vols {
+ var uid, gid int
+ uid, err = v.UID()
+ if err != nil {
+ return nil, err
+ }
+ gid, err = v.GID()
+ if err != nil {
+ return nil, err
+ }
config := entities.VolumeConfigResponse{
Name: v.Name(),
Driver: v.Driver(),
@@ -103,8 +112,8 @@ func (ic *ContainerEngine) VolumeInspect(ctx context.Context, namesOrIds []strin
Labels: v.Labels(),
Scope: v.Scope(),
Options: v.Options(),
- UID: v.UID(),
- GID: v.GID(),
+ UID: uid,
+ GID: gid,
}
reports = append(reports, &entities.VolumeInspectReport{VolumeConfigResponse: &config})
}
@@ -141,6 +150,15 @@ func (ic *ContainerEngine) VolumeList(ctx context.Context, opts entities.VolumeL
}
reports := make([]*entities.VolumeListReport, 0, len(vols))
for _, v := range vols {
+ var uid, gid int
+ uid, err = v.UID()
+ if err != nil {
+ return nil, err
+ }
+ gid, err = v.GID()
+ if err != nil {
+ return nil, err
+ }
config := entities.VolumeConfigResponse{
Name: v.Name(),
Driver: v.Driver(),
@@ -149,8 +167,8 @@ func (ic *ContainerEngine) VolumeList(ctx context.Context, opts entities.VolumeL
Labels: v.Labels(),
Scope: v.Scope(),
Options: v.Options(),
- UID: v.UID(),
- GID: v.GID(),
+ UID: uid,
+ GID: gid,
}
reports = append(reports, &entities.VolumeListReport{VolumeConfigResponse: config})
}