Commit Graph

28501 Commits

Author SHA1 Message Date
Miloslav Trmač a02dbdbfa1 Only touch lock files after successful JSON writes
AtomicWriteFile truly is atomic, it only changes the file
on success. So there's no point notifying other processes about
a changed file if we failed, they are going to see the same JSON data.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-01 02:46:52 +02:00
Miloslav Trmač fb2df5d9fd Replace uses of deprecated functions from opencontainers/selinux/go-selinux/label
That also avoids warnings about missing error checks.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-01 02:46:52 +02:00
Miloslav Trmač e946df9d7a Deprecate API that can't return an error
... when we already provide variants that can do so.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-01 02:46:52 +02:00
Miloslav Trmač 3926780ab1 Misc error handling fixes or warning silences
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-01 02:46:52 +02:00
Miloslav Trmač f1e256e70d Introduce, and use, graphdriver.MustRegister
... instead of silently failing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-01 02:46:52 +02:00
Miloslav Trmač d1de06c839 Be explicit about how we ignore errors using trucindex.TruncIndex
This does not change behavior, it just makes it clearer
what is going on.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-01 02:46:52 +02:00
Daniel J Walsh fb9a8eaf77
Merge pull request #1374 from aarontomlin/atomlin-overlayfs-give-up-when-back-end-fs-is-unsupported
drivers/overlay: Notify the user if the backing filesystem is not supported with OverlayFS
2022-09-30 09:07:46 -04:00
Aaron Tomlin d9da33511d drivers/overlay: Notify the user if the backing filesystem is not supported with OverlayFS
If the backing filesystem is not supported with OverlayFS as a container
storage driver/or graph driver then do not continue.
In this context, report the incompatibility by notifying the user of an
unsupported configuration. The filesystem type/or ID that is returned by
the statfs(2) system call is reported too, to assist further
troubleshooting efforts. It can be used to deduce the actual filesystem
used for the container storage graph directory.

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
2022-09-30 12:27:45 +01:00
Giuseppe Scrivano d7c40ade04
Merge pull request #1371 from dfr/freebsd-refactor
pkg/archive: Use archive_unix.go on FreeBSD
2022-09-30 10:24:33 +02:00
Daniel J Walsh a2422d309c
Merge pull request #1372 from containers/dependabot/go_modules/github.com/opencontainers/selinux-1.10.2
build(deps): bump github.com/opencontainers/selinux from 1.10.1 to 1.10.2
2022-09-29 11:08:54 -04:00
dependabot[bot] 9945cd8269
build(deps): bump github.com/opencontainers/selinux
Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/opencontainers/selinux/releases)
- [Commits](https://github.com/opencontainers/selinux/compare/v1.10.1...v1.10.2)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/selinux
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-29 11:22:53 +00:00
Doug Rabson 8cd1f5a8c5 pkg/archive: Use archive_unix.go on FreeBSD
Almost all the code can be shared between Linux, FreeBSD and Darwin with
the only different in the handling of lchmod. On FreeBSD and Darwin (and
probably other BSDs) we can access lchmod functionality via
unix.Fchmodat.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-29 11:37:32 +01:00
Daniel J Walsh bb2504f7bb
Merge pull request #1369 from rhatdan/lock
Fix accessing containers and image locks
2022-09-28 19:38:42 -04:00
Daniel J Walsh 6a0251d8cb
Merge pull request #1370 from rhatdan/VERSION
Bump to version v1.43.0
2022-09-28 14:58:07 -04:00
Daniel J Walsh 0ba908a472
Move to v1.43.1-dev
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-28 14:57:18 -04:00
Daniel J Walsh 04d8b90f9d
Bump to v1.43.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-28 14:57:14 -04:00
Daniel J Walsh c9c7d28334
Fix accessing containers and image locks
Match containers and image lock to the new layer lock method.
in https://github.com/containers/storage/pull/1351

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-28 05:45:56 -04:00
Daniel J Walsh dcb8b687c0
Merge pull request #1367 from aarontomlin/atomlin-add-debug-data-to-getfsmagic
drivers/driver_linux: Show fstype in GetFSMagic() if debug logging is enabled
2022-09-28 05:43:31 -04:00
Giuseppe Scrivano 42f81a2a41
Merge pull request #1360 from dfr/freebsd-tests
Make the unit tests work for FreeBSD
2022-09-28 09:27:49 +02:00
Aaron Tomlin 04eb9630fc drivers/driver_linux: Show fstype in GetFSMagic() if debug logging is enabled
In the context of github.com/containers/storage/drivers.GetFSMagic()
when log-level debug is enabled show the filesystem type/or ID that is
returned by the statfs(2) system call in particular when the ID is not
known to podman. This might suggest an unsupported configuration.

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
2022-09-27 21:49:24 +01:00
Daniel J Walsh d9e14ec1dc
Merge pull request #1351 from tyler92/fix-panic-in-layers
Fix accessing to layer without lock
2022-09-27 16:21:20 -04:00
Daniel J Walsh 6fe129c37d
Merge pull request #1363 from rhatdan/config
Use system defaults if storage.conf does not exist in XDG_CONFIG_HOME
2022-09-27 15:50:29 -04:00
Daniel J Walsh 06fae83500
Merge pull request #1359 from rhatdan/XDG_RUNTIME_DIR
Eval symlinks on XDG_RUNTIME_DIR
2022-09-27 15:49:48 -04:00
Daniel J Walsh dfe3e779f8
Merge branch 'main' into XDG_RUNTIME_DIR 2022-09-27 15:22:38 -04:00
Daniel J Walsh f75d738e63
Use system defaults if storage.conf does not exist in XDG_CONFIG_HOME
Follow up to https://github.com/containers/storage/pull/1357

Podman tests suggest that do not need to use XDG_CONFIG_HOME if
storage.conf does not exists.  In that case we fall back to
/etc/containers/storage.conf and /usr/share/containers/storage.conf

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-27 14:21:54 -04:00
Doug Rabson acd039fd29 pkg/parsers/operatingsystem: Disable tests on FreeBSD
These are testing things like /etc/os-release and cgroups which are
linux-only.  Note: /etc/os-release does exist on FreeBSD but
GetOperatingSystem is implemented using uname.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-27 17:47:10 +01:00
Doug Rabson 544b12d197 pkg/archive: Disable tests which cannot work on FreeBSD
Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-27 17:47:10 +01:00
Doug Rabson bca9d5fd12 pkg/archive: Implement handleLChmod using lchmod on FreeBSD
This fixes a failure in TestApplyLayer caused by different modes on the
symlinks in the test due to the test setup using a different umask from
ApplyLayer. FreeBSD actually has an lchmod syscall and supports changing
the mode on symlinks so we can use that.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-27 17:47:10 +01:00
Doug Rabson 6147ac0c31 pkg/archive: Add a wrapper for os.Link which does not follow symlinks
On FreeBSD, the link syscall follows symlinks which makes
TestUntarHardlinkToSymlink fail. We can match the expected semantics on
FreeBSD using linkat.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-27 17:47:09 +01:00
Doug Rabson 8ee124d1b4 pkg/system: Sync the return type of Mkdev with the dev argument of Mknod
This avoids code having to cast the value returned by Mkdev and coding
in assuptions on the type of Mknod's dev argument.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-27 15:57:08 +01:00
Daniel J Walsh 85f5c34c11
Merge pull request #1366 from dfr/fix-test-epoch
tests/helpers.bash: Fix setting the mtime to epoch in createrandom
2022-09-27 10:17:27 -04:00
Doug Rabson eea8dd923f tests/helpers.bash: Fix setting the mtime to epoch in createrandom
This was setting the time to 1970-1-1 00:00 in the local timezone
instead of UTC which causes test failures if the local timezone has a
positive offset from UTC. Fixes #1365.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-27 13:04:20 +01:00
Daniel J Walsh c7969447be
Merge pull request #1357 from rhatdan/config
If XDG_CONFIG_HOME env is set we should use it and ignore defaults
2022-09-26 10:13:28 -04:00
Giuseppe Scrivano c79b49212c
Merge pull request #1358 from dfr/freebsd-tests
tests/idmaps.bats: only run idmaps tests on Linux
2022-09-24 21:51:28 +02:00
Doug Rabson f4e3c270d7 tests/idmaps.bats: only run idmaps tests on Linux
All the other integration tests pass on FreeBSD with the zfs driver.
Some of them fail with the vfs driver but those also fail on Linux.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-24 08:25:01 +01:00
Daniel J Walsh 9415b88c35
If XDG_CONFIG_HOME env is set we should use it and ignore defaults
HPC Customers noticed that storage was attempting to read files in /usr
and /etc, even though they set XDG_CONFIG_HOME, they expect to only read
config files in this directory.

Fixes: https://github.com/containers/podman/issues/15680

(Actually partial fixes), need to look at other config files.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-23 15:40:13 -04:00
Daniel J Walsh 57556f4016
Merge pull request #1355 from dfr/freebsd-chflags
pkg/system: Allow EnsureRemoveAll to delete trees with immutable files
2022-09-23 15:31:47 -04:00
Daniel J Walsh 2c8a1f356d
Eval symlinks on XDG_RUNTIME_DIR
Partial Fix for containers#14606

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-23 13:59:31 -04:00
Doug Rabson 7d496cb420 pkg/system: Allow EnsureRemoveAll to delete trees with immutable files
Fixes #1354.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-21 14:54:26 +01:00
Mikhail Khachayants e35b061b85 Fix accessing to layer without lock
There was a possibility to panic due to such behavior:
attempted to update last-writer in lockfile without the write lock

Fixes: https://github.com/containers/storage/issues/1324

Signed-off-by: Mikhail Khachayants <tyler92@inbox.ru>
2022-09-21 17:27:23 +04:00
Daniel J Walsh 8a581aac3b
Merge pull request #1353 from dfr/freebsd-utimes
Fix LUtimesNano on FreeBSD
2022-09-19 07:22:36 -04:00
Doug Rabson 2dbb0d069e Fix stat_unix_test on FreeBSD
This splits out the platform-specific parts to stat_linux_test.go and
stat_freebsd_test.go.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-17 16:38:21 +01:00
Doug Rabson 21b6cd738e Disable meminfo_unix_test on FreeBSD
This is really just testing parseMemInfo which is part of the linux
platform implementation.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-17 16:38:21 +01:00
Doug Rabson 8b9f40b169 Fix LUtimesNano on FreeBSD
The code was passing timespec arguments to lutimes which expects timeval
arguments. This likely only ever 'worked' because the nanoseconds field
is nearly always zero.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-17 16:38:14 +01:00
Valentin Rothberg 4e0f0fb8f5
Merge pull request #1350 from nalind/no-not-typos
Revert incorrect "heeded" -> "needed" typo fix
2022-09-16 09:21:38 +02:00
Giuseppe Scrivano b1d4d376b2
Merge pull request #1349 from nalind/update-go-zfs
Update to go-zfs v3.0.0
2022-09-15 21:28:06 +02:00
Giuseppe Scrivano 352df07336
Merge pull request #1348 from nalind/idmaps-imagestore
tests/idmaps.bats: only test .imagestore on overlay and vfs
2022-09-15 21:27:42 +02:00
Nalin Dahyabhai 5e9e2ba6b3 Revert incorrect "heeded" -> "needed" typo fix
A recent typo fix introduced a typo.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-09-15 15:18:51 -04:00
Daniel J Walsh 6aaf0b69a2
Merge pull request #1347 from nalind/ghost-of-ffjson
tests/tools/Makefile: we don't use ffjson any more
2022-09-15 10:48:22 -04:00
Nalin Dahyabhai faabec37fa Update to go-zfs v3.0.0
go-zfs migrated to Go modules, so we update our import path for it.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-09-15 10:25:40 -04:00