summaryrefslogtreecommitdiff
path: root/libpod/container_inspect.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-06-11 14:40:38 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-06-15 07:05:56 -0400
commit200cfa41a434b7143620c2c252b3eb7ab3ef92f9 (patch)
treeccf0cb95297dc65d4dc8bd366963e2b037fb1a8b /libpod/container_inspect.go
parent3f026eb6a682a68e69f9376b72157a8f084e575c (diff)
downloadpodman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.tar.gz
podman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.tar.bz2
podman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.zip
Turn on More linters
- misspell - prealloc - unparam - nakedret Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r--libpod/container_inspect.go13
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