Commit Graph

10 Commits

Author SHA1 Message Date
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
Daniel J Walsh a3204cf7e8
Move to golang 1.18 and later
Github.com is reporting security issues on older versions of
golang.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-03 15:26:54 -04:00
Nalin Dahyabhai 7c979809d9 Comment fixups
A recent PR merge added mid-sentence blank links to a few comments.
Revert those changes and update adjacent comments to follow suit.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-09-14 10:53:00 -04:00
Miloslav Trmač a1ccc9d862 Use os.WriteFile instead of ioutil.WriteFile
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-09-12 16:31:34 +02:00
Eng Zer Jun 6ea3603b6b
test: use `T.TempDir` to create temporary test directory
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-30 01:21:37 +08:00
Nalin Dahyabhai cbef82ca7b pkg/archive/overlayWhiteoutConverter.ConvertWrite(): force mode to 0
Force the mode for whiteouts that have been converted from overlay
format (produced by overlay native diff) to aufs format to 0x0, to match
the permissions we assign to whiteouts we create when using naive diff.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-04-11 10:47:02 -04:00
Tycho Andersen 0a8ace983c archive/overlay: ignore failures from nested whiteouts
See comment for the situation that arises, we've seen this with images
generated by very old dockers (and possibly others?).

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2021-05-18 08:03:37 -06:00
Giuseppe Scrivano 9bf64bb716
archive, rootless: use user.* instead of trusted.*
unprivileged users cannot use the trusted.* xattrs.  Since for
rootless we always mount overlay with userxattr, we can just check if
running in rootless mode and use user.* instead of trusted.*.

Closes: https://github.com/containers/podman/issues/9936

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-04-06 17:10:24 +02:00
Nalin Dahyabhai 3063635862 archive.Tar: don't trust the "trusted.overlay.opaque" xattr
If the overlay filesystem implements an optimization that landed in
97c684cc911060ba7f97c0925eaf842f159a39e8, and in the mainline kernel in
4.10, directories created in merged directories are marked as opaque by
the kernel to let the kernel know that it needn't bother looking at
other layers when reading the contents of that directory.

This means that, when generating a diff for an upper directory, we can't
treat the presence of an opaque attribute as enough of an indication
that a layer diff needs to include whiteout for a directory of the same
name from a lower layer.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-02-23 16:00:48 -05: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