Just test all sub dirs instead of having to list them one by one.
Also the remote tag is only used by pkg/config so no need to test all
the others as well. Also keep the seccomp tag, we cannot add it to
the default as this breaks the cross builds form some reason.
Fixes#1681
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Add a custom plugin that can be used in the netavark unit tests to check
if the integration works as expected.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Used `go fmt` rules to migrate away from deprecated functions, for
instance `gofmt -w -s -r 'ioutil.TempDir(a, b) -> os.MkdirTemp(a, b)'`
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
The cgo-enabled builds require Linux include files and libraries.
This change makes it possible to build the non-cgo versions on
non-Linux platforms.
Signed-off-by: Doug Rabson <dfr@rabson.org>
1. Greatly simplify the golangci-lint config.
1.1. Remove the skip-dir list (of excluded directories), since as all
the issues are now fixed).
1.2. Instead of enabling all the linters and then disabling many of
them, go with the default set of enabled linters, and then add some
(currently just gocritic and dupl).
This will hopefully make upgrading golangci-lint easier, as it
maintains a sensitive set of linters enabled by default (and
enabling all linters by default means we will enable some new and
unknown linters when we bump golangci-lint version).
1.3. Remove the gocritic list of enabled linters, use a default one.
The motivation is similar -- it is hard to maintain/upgrade otherwise.
1.4. Remove the "check-blank: true" option from the errcheck linter, as
we often use _ = fn() type of assignment to denote that we want to
ignore the error.
2. Simplify golangci-lint installation from the Makefile.
3. Bump golangci-lint to 1.45.2.
NOTE that if you are using golangci-lint locally, you have to remove it
from the build directory (i.e. rm -f build/golangci-lint) before running
"make validate").
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Quite a few changes, mostly removing old stuff though.
1. "GO111MODULE=off" is no longer required to be set by default (and
it used to be overridden below anyway).
2. "go build" no longer requires explicit "-mod=vendor", as this is the
default since go 1.14.
3. GOPROXY is set to proxy.golang.org by default since go 1.13.
4. Always use default GOPATH (which is $HOME/go since Go 1.8; earlier
releases needed to set it explicitly).
5. Drop the code that handles multiple comma-separated GOPATH elements
(when using modules, GOPATH is no longer used for resolving imports,
which basically means using multiple paths is useless).
6. Drop go-get macro (which is used to install md2man), use go install
directly (supported since Go 1.16). While at it, do not check if
go-md2man is available, install it unconditionally. This removes
the need to have GOBIN make variable.
7. Remove GOPKGBASEDIR and GOPKGBASEDIR, defined by Makefile, were never
used.
8. Rm PROJECT, use relative paths in test-unit target.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Move codespell options from Makefile to .codespellrc.
While at it, remove some exclusions that apparently are no longer
needed.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Container/storage now only links in libsubid if libsubid tag is set.
no_libsubid tag no longer exists.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
The new `libimage` package is an attempt to consolidate the code for
managing container images and performing operations on them such as
pulling, pushing, saving, searching, local lookups, removing etc.
Over time, Buildah, CRI-O and Podman diverged with respect to managing
container images resulting in a high amount of code duplication
rendering the tools harder to maintain (e.g., bug fixes) and harder to
extend (e.g., adding new features) than necessary.
The desire to share all that code in a common library grew and this is
an attempt to address the it.
The changes as they are now pass Buildah CI [1]. Once merged into
Buildah, I expect follow up changes when migrating Podman over to
`libimage`.
Miscellaneous changes:
* Copy `podman/pkg/signal` to `pkg/signal`.
* Copy `buildah/manifests` to `image/manifests`. Note that the unit
tests require root privileges. Skip()'s are added when running
rootless. Currently excluded from linting.
* Copy `buildah/pkg/manifests` to `pkg/manifests`. Currently excluded
from linting.
* Copy `buildah/pkg/supplemented` to `pkg/supplemented`. Currently
excluded from linting.
[1] github.com/containers/buildah/pull/3148
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
syscall.ERESTART is not defined on Darwin, so move to
an unsupported package. While this would work on Windows
this code most likey never will, so rather then complicate
code, I just left ERESTART on Windows as not supported.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This also updates the target directory of the linter binary, which is
now inside the repository instead of `$GOBIN`.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Modify validate functions to work on a remote clients.
Any of the path checks will not work on remote machines or make
sense on remote clients. Therefore they should not be checked.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
(export a=b command args) does not run (command args) with a=b,
it sets $a to b, and marks variables $a $command $args as exported,
i.e. (command args) is not run.
So we were not actually running (go mod tidy).
Signed-off-by: Miloslav Trmač <mitr@redhat.com>