Commit Graph

11 Commits

Author SHA1 Message Date
Miloslav Trmač 35b3e0f41b Avoid unnecessary manually-coded loops
Use the "slices", "maps" standard library packages, or other
readily-available features.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-09-05 19:45:45 +02:00
Kir Kolyshkin a4d8f720a2 Format sources with gofumpt
gofumpt is a superset of gofmt, enabling some more code formatting
rules.

This commit is brought to you by

	gofumpt -w .

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2023-05-26 16:17:31 -07:00
Paul Holzinger bb74ff653c
fix inconsitent go build tags
Run `go fmt ./...` which automatically adds the new build tag syntax.
This change is backwards compatible.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-11-02 20:51:27 +01:00
Daniel J Walsh f53a5bc105
Make linters happy
Check lots of potential error situations.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-11 14:47:31 -04:00
Kir Kolyshkin 2c0f1b3e01 pkg/mount: drop solaris and freebsd support
It is not being maintained, is probably broken,
and there are no users.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-03-10 06:41:18 -07:00
Kir Kolyshkin c0266c1333 pkg/mount tests: skip some tests if !root
Tests that require calls to mount(2)/umount(2) are failing
when run under non-root user. Let's check if we're root
first and skip if we're not.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-03-07 19:50:00 -08:00
Sascha Grunert b66d5a5c12
Enable goconst linter and fix lints
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-01-28 15:59:15 +01:00
Daniel J Walsh 2569af9a00
Fix overlay to handle mountopt properly
We need to translate the mount options into flags or
data, so this PR makes the parse code public so we can
use it in containers/storage.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-07-25 16:52:03 -04:00
Daniel J Walsh f39066fe1b Update packages to match latest code in moby/pkg
Had to vendor in a new version of golang.org/x/net to build
Also had to make some changes to drivers to handle
archive.Reader -> io.Reader
archive.Archive -> io.ReadCloser

Also update .gitingore to ignore emacs files, containers-storage.*
and generated man pages.

Also no longer test travis against golang 1.7, cri-o, moby have also
done this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-09-12 18:00:29 +00:00
Yong Tang 397a6fefad Inconsistent --tmpfs behavior
This fix tries to address the issue raised in #22420. When
`--tmpfs` is specified with `/tmp`, the default value is
`rw,nosuid,nodev,noexec,relatime,size=65536k`. When `--tmpfs`
is specified with `/tmp:rw`, then the value changed to
`rw,nosuid,nodev,noexec,relatime`.

The reason for such an inconsistency is because docker tries
to add `size=65536k` option only when user provides no option.

This fix tries to address this issue by always pre-progating
`size=65536k` along with `rw,nosuid,nodev,noexec,relatime`.
If user provides a different value (e.g., `size=8192k`), it
will override the `size=65536k` anyway since the combined
options will be parsed and merged to remove any duplicates.

Additional test cases have been added to cover the changes
in this fix.

This fix fixes #22420.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-26 19:28:18 -07:00
John Howard d509e61540 Windows CI: Unit Test - pkg/mount is Unix specific
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-10 18:09:15 -08:00