diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-15 09:19:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 09:19:40 -0400 |
commit | f4c3b718eb22a161a897a6ed55d10f3a07e31aa8 (patch) | |
tree | bb453d40a50f8cef1ebfedc73e43e2c7fe7d3456 /libpod/container_inspect.go | |
parent | e94e3fd2e829fd2cd38428aa9d9bf68b37bb8407 (diff) | |
parent | 200cfa41a434b7143620c2c252b3eb7ab3ef92f9 (diff) | |
download | podman-f4c3b718eb22a161a897a6ed55d10f3a07e31aa8.tar.gz podman-f4c3b718eb22a161a897a6ed55d10f3a07e31aa8.tar.bz2 podman-f4c3b718eb22a161a897a6ed55d10f3a07e31aa8.zip |
Merge pull request #6557 from rhatdan/lint
Turn on More linters
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r-- | libpod/container_inspect.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index b26dcddf6..c6d9e1a65 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -90,7 +90,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *driver.Data) } namedVolumes, mounts := c.sortUserVolumes(ctrSpec) - inspectMounts, err := c.getInspectMounts(ctrSpec, namedVolumes, mounts) + inspectMounts, err := c.getInspectMounts(namedVolumes, mounts) if err != nil { return nil, err } @@ -164,10 +164,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *driver.Data) } data.NetworkSettings = networkConfig - inspectConfig, err := c.generateInspectContainerConfig(ctrSpec) - if err != nil { - return nil, err - } + inspectConfig := c.generateInspectContainerConfig(ctrSpec) data.Config = inspectConfig hostConfig, err := c.generateInspectContainerHostConfig(ctrSpec, namedVolumes, mounts) @@ -195,7 +192,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *driver.Data) // Get inspect-formatted mounts list. // Only includes user-specified mounts. Only includes bind mounts and named // volumes, not tmpfs volumes. -func (c *Container) getInspectMounts(ctrSpec *spec.Spec, namedVolumes []*ContainerNamedVolume, mounts []spec.Mount) ([]define.InspectMount, error) { +func (c *Container) getInspectMounts(namedVolumes []*ContainerNamedVolume, mounts []spec.Mount) ([]define.InspectMount, error) { inspectMounts := []define.InspectMount{} // No mounts, return early @@ -278,7 +275,7 @@ func parseMountOptionsForInspect(options []string, mount *define.InspectMount) { } // Generate the InspectContainerConfig struct for the Config field of Inspect. -func (c *Container) generateInspectContainerConfig(spec *spec.Spec) (*define.InspectContainerConfig, error) { +func (c *Container) generateInspectContainerConfig(spec *spec.Spec) *define.InspectContainerConfig { ctrConfig := new(define.InspectContainerConfig) ctrConfig.Hostname = c.Hostname() @@ -325,7 +322,7 @@ func (c *Container) generateInspectContainerConfig(spec *spec.Spec) (*define.Ins ctrConfig.CreateCommand = c.config.CreateCommand - return ctrConfig, nil + return ctrConfig } // Generate the InspectContainerHostConfig struct for the HostConfig field of |