The new configuration file was initially generated by golangci-lint
migrate, when tweaked to minimize and simplify.
golangci-lint v2 switches to a new version of staticcheck which shows
much more warnings. Some of them were fixed by a few previous commits,
and the rest of them are disabled.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1. Move codespell config out of Makefile, simplify (remove unused
stuff).
2. Fix found issues (using codespell -w).
3. Add a codespell CI job.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit makes use of golangci-lint to check that the source code is
formatted with gofumpt, and removes hack/gofmt.sh which is no longer
needed.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Remove some old time artifacts, such as:
- GO111MODULES, GO_PROXY, and MOD_VENDOR (no longer needed since go 1.14);
- GIT_BRANCH (not needed since 2016, commit d855327b5e);
- EPOCH_TEST_COMMIT (not needed since 2017, commit 230b9ab91a);
except that -mod=vendor is needed for go build in tests/tools.
Also remove:
- PROJECT_ROOT (and use of "go list" for tests);
- sources (go build is efficient so we can use it every time without
using make to compare sources timestamps).
This makes makefiles less cluttered, and should also fix the following
golangci-lint error observed in CI:
> running gomoddirectives failed: failed to get module file: command
> go list: exit status 1: go: list -m cannot be used with GO111MODULE=off:
> if you are not using go modules it is suggested to disable this linter"
As a result, golangci-lint was effectively disabled.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Implement ListLayers() for the aufs, btrfs, and devicemapper drivers,
along with a unit test for them.
Stop filtering out directories with names that aren't 64-hex chars in
vfs and overlay ListLayers() implementations, which is more a convention
than a hard rule.
Have layerStore.Wipe() try to remove remaining listed layers after it
removes the layers that the layerStore knew of.
Close() a dangling ReadCloser in NaiveCreateFromTemplate.
Switch from using plain defer to using t.Cleanup() to handle deleting
layers that tests create, have the addManyLayers() test function do so
as well.
Remove vfs.CopyDir, which near as I can tell isn't referenced anywhere.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When updateNames() copies an image's record from a read-only store into
the read-write store, copy the accompanying data as well.
Add fields for setting data items at creation-time to LayerOptions,
ImageOptions, and ContainerOptions to make this easier for us and our
consumers.
Replace the store-specific Create() (and the one CreateWithFlags() and
Put()) with private create() and put() methods, since they're not
intended for consumption outside of this package, and add Flags to the
options structures we pass into those methods. In create() methods,
make copies of those passed-in options structures before modifying any
of their contents.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Remove targets that reference Vagrant-specific setups that were removed
well over a year ago (!), and update $(sources) to include files in new
packages.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Make sure all PRs are formated with `go fmt` correctly.
I added it to the existing lint job as this seems to make the most
sense to me.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This makefile requires GNU make and on n FreeBSD and probably other BSD
variants, this is installed as /usr/local/bin/gmake.
Signed-off-by: Doug Rabson <dfr@rabson.org>
when building with cgo, add support for libsubid to read the
additional sub IDs for the user instead of parsing the /etc/sub?id
files.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
If the current platform passes unit tests in the stringutils package,
assume we're on a platform where unit tests can use the -race flag, and
use it with our unit tests.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
The unit tests should not download dependencies ad-hoc but use the local
vendored sources for sake of reproducibility.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
In order to always run vendor with the latest supported version of golang,
add the ability to run the vendor command within a podman container.
After running the command include vendor changes.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
it was an attempt to use OSTree to deduplicate files, at the time we
already had a dependency on OSTree for system containers in
containers/image. Since the feature never really took off, let's just
drop it.
Closes: https://github.com/containers/storage/issues/419
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>