Populate remaining unused fields in pod inspect

We were hard-coding two fields to false, instead of grabbing
their value from the pod config, which means that `pod inspect`
would print the wrong value always.

Fixes #6968

Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
Matthew Heon
2020-07-14 09:07:08 -04:00
parent 41457b5a28
commit 1fdfd52eeb

View File

@ -535,10 +535,10 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) {
State: podState, State: podState,
Hostname: p.config.Hostname, Hostname: p.config.Hostname,
Labels: p.Labels(), Labels: p.Labels(),
CreateCgroup: false, CreateCgroup: p.config.UsePodCgroup,
CgroupParent: p.CgroupParent(), CgroupParent: p.CgroupParent(),
CgroupPath: p.state.CgroupPath, CgroupPath: p.state.CgroupPath,
CreateInfra: false, CreateInfra: infraConfig != nil,
InfraContainerID: p.state.InfraContainerID, InfraContainerID: p.state.InfraContainerID,
InfraConfig: infraConfig, InfraConfig: infraConfig,
SharedNamespaces: sharesNS, SharedNamespaces: sharesNS,