mirror of https://github.com/containers/podman.git
rootless: fix top huser and hgroup
when running in rootless mode, be sure psgo is honoring the user namespace settings for huser and hgroup. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
da3021edd1
commit
e85b33fb04
|
@ -6,6 +6,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/containers/libpod/pkg/rootless"
|
||||||
"github.com/containers/psgo"
|
"github.com/containers/psgo"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
@ -47,7 +48,9 @@ func (c *Container) GetContainerPidInformation(descriptors []string) ([]string,
|
||||||
// filters on the data. We need to change the API here and the
|
// filters on the data. We need to change the API here and the
|
||||||
// varlink API to return a [][]string if we want to make use of
|
// varlink API to return a [][]string if we want to make use of
|
||||||
// filtering.
|
// filtering.
|
||||||
psgoOutput, err := psgo.JoinNamespaceAndProcessInfo(pid, descriptors)
|
opts := psgo.JoinNamespaceOpts{FillMappings: rootless.IsRootless()}
|
||||||
|
|
||||||
|
psgoOutput, err := psgo.JoinNamespaceAndProcessInfoWithOptions(pid, descriptors, &opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/containers/libpod/pkg/rootless"
|
||||||
"github.com/containers/psgo"
|
"github.com/containers/psgo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -43,7 +44,8 @@ func (p *Pod) GetPodPidInformation(descriptors []string) ([]string, error) {
|
||||||
// filters on the data. We need to change the API here and the
|
// filters on the data. We need to change the API here and the
|
||||||
// varlink API to return a [][]string if we want to make use of
|
// varlink API to return a [][]string if we want to make use of
|
||||||
// filtering.
|
// filtering.
|
||||||
output, err := psgo.JoinNamespaceAndProcessInfoByPids(pids, descriptors)
|
opts := psgo.JoinNamespaceOpts{FillMappings: rootless.IsRootless()}
|
||||||
|
output, err := psgo.JoinNamespaceAndProcessInfoByPidsWithOptions(pids, descriptors, &opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue