summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-02-11 22:55:56 +0100
committerPaul Holzinger <paul.holzinger@web.de>2021-02-11 23:01:56 +0100
commit78c8a87362ee27ba1d2a62b7c9d73adc313c7d7e (patch)
tree12fdfd2472f66e68081a89b0019621c1b8a1586c /libpod
parent69ab67bf90aa4bbd285f360e3bca4c85b6028908 (diff)
downloadpodman-78c8a87362ee27ba1d2a62b7c9d73adc313c7d7e.tar.gz
podman-78c8a87362ee27ba1d2a62b7c9d73adc313c7d7e.tar.bz2
podman-78c8a87362ee27ba1d2a62b7c9d73adc313c7d7e.zip
Enable whitespace linter
Use the whitespace linter and fix the reported problems. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/boltdb_state.go3
-rw-r--r--libpod/container.go1
-rw-r--r--libpod/container_inspect.go1
-rw-r--r--libpod/container_internal_linux.go1
-rw-r--r--libpod/container_path_resolution.go2
-rw-r--r--libpod/events/events.go1
-rw-r--r--libpod/events/filters.go1
-rw-r--r--libpod/events/logfile.go1
-rw-r--r--libpod/image/image.go1
-rw-r--r--libpod/image/image_test.go1
-rw-r--r--libpod/image/prune.go2
-rw-r--r--libpod/image/utils.go1
-rw-r--r--libpod/network/create.go1
-rw-r--r--libpod/network/create_test.go1
-rw-r--r--libpod/network/netconflist_test.go1
-rw-r--r--libpod/oci_conmon_linux.go2
-rw-r--r--libpod/oci_util.go1
-rw-r--r--libpod/options.go3
-rw-r--r--libpod/reset.go1
-rw-r--r--libpod/runtime.go5
-rw-r--r--libpod/runtime_ctr.go1
-rw-r--r--libpod/runtime_img_test.go1
-rw-r--r--libpod/runtime_pod_infra_linux.go1
23 files changed, 0 insertions, 34 deletions
diff --git a/libpod/boltdb_state.go b/libpod/boltdb_state.go
index df00a8851..c9d214cd0 100644
--- a/libpod/boltdb_state.go
+++ b/libpod/boltdb_state.go
@@ -904,7 +904,6 @@ func (s *BoltState) ContainerInUse(ctr *Container) ([]string, error) {
}
return depCtrs, nil
-
}
// AllContainers retrieves all the containers in the database
@@ -962,7 +961,6 @@ func (s *BoltState) AllContainers() ([]*Container, error) {
}
return nil
-
})
})
if err != nil {
@@ -2580,7 +2578,6 @@ func (s *BoltState) LookupVolume(name string) (*Volume, error) {
}
return volume, nil
-
}
// HasVolume returns true if the given volume exists in the state, otherwise it returns false
diff --git a/libpod/container.go b/libpod/container.go
index e667cd991..613a02554 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -1057,7 +1057,6 @@ func (c *Container) NetworkDisabled() (bool, error) {
return container.NetworkDisabled()
}
return networkDisabled(c)
-
}
func networkDisabled(c *Container) (bool, error) {
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index efe09af92..e87e26c61 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -796,7 +796,6 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named
if c.config.UTSNsCtr != "" {
utsMode = fmt.Sprintf("container:%s", c.config.UTSNsCtr)
} else if ctrSpec.Linux != nil {
-
// Locate the spec's UTS namespace.
// If there is none, it's uts=host.
// If there is one and it has a path, it's "ns:".
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index da8f07c9e..a3476f42e 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -1614,7 +1614,6 @@ func (c *Container) makeBindMounts() error {
return errors.Wrapf(err, "error setting timezone for container %s", c.ID())
}
c.state.BindMounts["/etc/localtime"] = localtimePath
-
}
}
diff --git a/libpod/container_path_resolution.go b/libpod/container_path_resolution.go
index 51e3844c8..5245314ae 100644
--- a/libpod/container_path_resolution.go
+++ b/libpod/container_path_resolution.go
@@ -86,14 +86,12 @@ func (c *Container) resolvePath(mountPoint string, containerPath string) (string
return "", "", err
}
return mount.Source, absolutePathOnTheBindMount, nil
-
}
if searchPath == "/" {
// Cannot go beyond "/", so we're done.
break
}
-
// Walk *down* the path (e.g., "/foo/bar/x" -> "/foo/bar").
searchPath = filepath.Dir(searchPath)
}
diff --git a/libpod/events/events.go b/libpod/events/events.go
index aa0401b62..01ea6a386 100644
--- a/libpod/events/events.go
+++ b/libpod/events/events.go
@@ -97,7 +97,6 @@ func newEventFromJSONString(event string) (*Event, error) {
return nil, err
}
return &e, nil
-
}
// ToString converts a Type to a string
diff --git a/libpod/events/filters.go b/libpod/events/filters.go
index 62891d32c..26e1e10ba 100644
--- a/libpod/events/filters.go
+++ b/libpod/events/filters.go
@@ -86,7 +86,6 @@ func generateEventSinceOption(timeSince time.Time) func(e *Event) bool {
func generateEventUntilOption(timeUntil time.Time) func(e *Event) bool {
return func(e *Event) bool {
return e.Time.Before(timeUntil)
-
}
}
diff --git a/libpod/events/logfile.go b/libpod/events/logfile.go
index 05ae3ce52..c5feabe66 100644
--- a/libpod/events/logfile.go
+++ b/libpod/events/logfile.go
@@ -39,7 +39,6 @@ func (e EventLogFile) Write(ee Event) error {
return err
}
return nil
-
}
// Reads from the log file
diff --git a/libpod/image/image.go b/libpod/image/image.go
index d732aecfe..8d8af0064 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -1688,7 +1688,6 @@ func (i *Image) GetConfigBlob(ctx context.Context) (*manifest.Schema2Image, erro
return nil, errors.Wrapf(err, "unable to parse image blob for %s", i.ID())
}
return &blob, nil
-
}
// GetHealthCheck returns a HealthConfig for an image. This function only works with
diff --git a/libpod/image/image_test.go b/libpod/image/image_test.go
index 2704b8baf..8055ef7b1 100644
--- a/libpod/image/image_test.go
+++ b/libpod/image/image_test.go
@@ -66,7 +66,6 @@ func makeLocalMatrix(b, bg *Image) []localImageTest {
l = append(l, busybox, busyboxGlibc)
return l
-
}
func TestMain(m *testing.M) {
diff --git a/libpod/image/prune.go b/libpod/image/prune.go
index 587c99333..6f026f630 100644
--- a/libpod/image/prune.go
+++ b/libpod/image/prune.go
@@ -52,7 +52,6 @@ func generatePruneFilterFuncs(filter, filterValue string) (ImageFilter, error) {
}
return false
}, nil
-
}
return nil, nil
}
@@ -170,7 +169,6 @@ func (ir *Runtime) PruneImages(ctx context.Context, all bool, filter []string) (
Size: uint64(imgSize),
})
}
-
}
return preports, nil
}
diff --git a/libpod/image/utils.go b/libpod/image/utils.go
index 6cc613b28..8882adcc1 100644
--- a/libpod/image/utils.go
+++ b/libpod/image/utils.go
@@ -45,7 +45,6 @@ func findImageInRepotags(search imageParts, images []*Image) (*storage.Image, er
}
}
if len(candidates) == 0 {
-
return nil, errors.Wrapf(define.ErrNoSuchImage, "unable to find a name and tag match for %s in repotags", searchName)
}
diff --git a/libpod/network/create.go b/libpod/network/create.go
index deacf487a..c58d62575 100644
--- a/libpod/network/create.go
+++ b/libpod/network/create.go
@@ -75,7 +75,6 @@ func validateBridgeOptions(options entities.NetworkCreateOptions) error {
}
return nil
-
}
// parseMTU parses the mtu option
diff --git a/libpod/network/create_test.go b/libpod/network/create_test.go
index 0b828e635..017bf31fe 100644
--- a/libpod/network/create_test.go
+++ b/libpod/network/create_test.go
@@ -8,7 +8,6 @@ import (
)
func Test_validateBridgeOptions(t *testing.T) {
-
tests := []struct {
name string
subnet net.IPNet
diff --git a/libpod/network/netconflist_test.go b/libpod/network/netconflist_test.go
index 5ff733f0f..161764ed9 100644
--- a/libpod/network/netconflist_test.go
+++ b/libpod/network/netconflist_test.go
@@ -7,7 +7,6 @@ import (
)
func TestNewIPAMDefaultRoute(t *testing.T) {
-
tests := []struct {
name string
isIPv6 bool
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 23bfb29d7..38ffba7d2 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -1228,7 +1228,6 @@ func prepareProcessExec(c *Container, options *ExecOptions, env []string, sessio
if options.Cwd != "" {
pspec.Cwd = options.Cwd
-
}
var addGroups []string
@@ -1798,5 +1797,4 @@ func httpAttachNonTerminalCopy(container *net.UnixConn, http *bufio.ReadWriter,
return err
}
}
-
}
diff --git a/libpod/oci_util.go b/libpod/oci_util.go
index d40cf13bd..4ec050d6d 100644
--- a/libpod/oci_util.go
+++ b/libpod/oci_util.go
@@ -103,7 +103,6 @@ func bindPorts(ports []ocicni.PortMapping) ([]*os.File, error) {
}
default:
return nil, fmt.Errorf("unknown protocol %s", i.Protocol)
-
}
}
return files, nil
diff --git a/libpod/options.go b/libpod/options.go
index 74ee60fef..8831f527e 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1109,7 +1109,6 @@ func WithLogTag(tag string) CtrCreateOption {
return nil
}
-
}
// WithCgroupsMode disables the creation of CGroups for the conmon process.
@@ -1131,7 +1130,6 @@ func WithCgroupsMode(mode string) CtrCreateOption {
return nil
}
-
}
// WithCgroupParent sets the Cgroup Parent of the new container.
@@ -1430,7 +1428,6 @@ func WithOverlayVolumes(volumes []*ContainerOverlayVolume) CtrCreateOption {
}
for _, vol := range volumes {
-
ctr.config.OverlayVolumes = append(ctr.config.OverlayVolumes, &ContainerOverlayVolume{
Dest: vol.Dest,
Source: vol.Source,
diff --git a/libpod/reset.go b/libpod/reset.go
index 24efeed40..3346f9d3f 100644
--- a/libpod/reset.go
+++ b/libpod/reset.go
@@ -16,7 +16,6 @@ import (
// Reset removes all storage
func (r *Runtime) Reset(ctx context.Context) error {
-
pods, err := r.GetAllPods()
if err != nil {
return err
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 1ad39fe2f..42af2046d 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -146,7 +146,6 @@ func NewRuntime(ctx context.Context, options ...RuntimeOption) (*Runtime, error)
// An error will be returned if the configuration file at the given path does
// not exist or cannot be loaded
func NewRuntimeFromConfig(ctx context.Context, userConfig *config.Config, options ...RuntimeOption) (*Runtime, error) {
-
return newRuntimeFromConfig(ctx, userConfig, options...)
}
@@ -382,7 +381,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
// Initialize remaining OCI runtimes
for name, paths := range runtime.config.Engine.OCIRuntimes {
-
ociRuntime, err := newConmonOCIRuntime(name, paths, runtime.conmonPath, runtime.runtimeFlags, runtime.config)
if err != nil {
// Don't fatally error.
@@ -437,7 +435,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
// Set up the CNI net plugin
if !rootless.IsRootless() {
-
netPlugin, err := ocicni.InitCNI(runtime.config.Network.DefaultNetwork, runtime.config.Network.NetworkConfigDir, runtime.config.Network.CNIPluginDirs...)
if err != nil {
return errors.Wrapf(err, "error configuring CNI network plugin")
@@ -484,7 +481,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
if became {
os.Exit(ret)
}
-
}
// If the file doesn't exist, we need to refresh the state
// This will trigger on first use as well, but refreshing an
@@ -787,7 +783,6 @@ type DBConfig struct {
// mergeDBConfig merges the configuration from the database.
func (r *Runtime) mergeDBConfig(dbConfig *DBConfig) {
-
c := &r.config.Engine
if !r.storageSet.RunRootSet && dbConfig.StorageTmp != "" {
if r.storageConfig.RunRoot != dbConfig.StorageTmp &&
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 49cf42626..1b3532f1f 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -1139,7 +1139,6 @@ func (r *Runtime) IsStorageContainerMounted(id string) (bool, string, error) {
// StorageContainers returns a list of containers from containers/storage that
// are not currently known to Podman.
func (r *Runtime) StorageContainers() ([]storage.Container, error) {
-
if r.store == nil {
return nil, define.ErrStoreNotInitialized
}
diff --git a/libpod/runtime_img_test.go b/libpod/runtime_img_test.go
index 6ca4d900b..40d5860cf 100644
--- a/libpod/runtime_img_test.go
+++ b/libpod/runtime_img_test.go
@@ -26,7 +26,6 @@ func createTmpFile(content []byte) (string, error) {
if _, err := tmpfile.Write(content); err != nil {
return "", err
-
}
if err := tmpfile.Close(); err != nil {
return "", err
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go
index 564851f4e..bc37bdb23 100644
--- a/libpod/runtime_pod_infra_linux.go
+++ b/libpod/runtime_pod_infra_linux.go
@@ -24,7 +24,6 @@ const (
)
func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawImageName, imgID string, config *v1.ImageConfig) (*Container, error) {
-
// Set up generator for infra container defaults
g, err := generate.New("linux")
if err != nil {