summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-28 12:40:14 -0400
committerGitHub <noreply@github.com>2021-09-28 12:40:14 -0400
commit14acec94b7f86ae329018e1e56fd111ff58bf057 (patch)
tree4ce14ad86a10621ac7b36130a6f839da40f50d41 /libpod/container_internal.go
parent05f62e31f94f85529e6a6fa6cf9c3e00df7bbb3d (diff)
parent5d6ea90e756cd48c90d9549d25c0150c9bb5c50c (diff)
downloadpodman-14acec94b7f86ae329018e1e56fd111ff58bf057.tar.gz
podman-14acec94b7f86ae329018e1e56fd111ff58bf057.tar.bz2
podman-14acec94b7f86ae329018e1e56fd111ff58bf057.zip
Merge pull request #11768 from vrothberg/deep-copy
libpod: do not call (*container).Config()
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index cb691dfd8..e81f2ec5f 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -923,12 +923,11 @@ func (c *Container) checkDependenciesRunning() ([]string, error) {
}
// Check the status
- conf := depCtr.Config()
state, err := depCtr.State()
if err != nil {
return nil, errors.Wrapf(err, "error retrieving state of dependency %s of container %s", dep, c.ID())
}
- if state != define.ContainerStateRunning && !conf.IsInfra {
+ if state != define.ContainerStateRunning && !depCtr.config.IsInfra {
notRunning = append(notRunning, dep)
}
depCtrs[dep] = depCtr
@@ -1003,7 +1002,7 @@ func (c *Container) cniHosts() string {
for _, status := range c.getNetworkStatus() {
for _, netInt := range status.Interfaces {
for _, netAddress := range netInt.Networks {
- hosts += fmt.Sprintf("%s\t%s %s\n", netAddress.Subnet.IP.String(), c.Hostname(), c.Config().Name)
+ hosts += fmt.Sprintf("%s\t%s %s\n", netAddress.Subnet.IP.String(), c.Hostname(), c.config.Name)
}
}
}
@@ -2106,7 +2105,7 @@ func (c *Container) canWithPrevious() error {
// JSON files for later export
func (c *Container) prepareCheckpointExport() error {
// save live config
- if _, err := metadata.WriteJSONFile(c.Config(), c.bundlePath(), metadata.ConfigDumpFile); err != nil {
+ if _, err := metadata.WriteJSONFile(c.config, c.bundlePath(), metadata.ConfigDumpFile); err != nil {
return err
}