Commit Graph

39 Commits

Author SHA1 Message Date
Paul Holzinger c6424dbe78 Makefile: simplify unit tests
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>
2023-10-05 13:07:20 +02:00
Aditya R d48687f258 Makefile: run libimage tests recursively
Manifests tests were not running at all in upstream CI, following PR
fixes that.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-09-28 12:04:30 +05:30
Valentin Rothberg 337d3434ce bump golangci-lint to v1.53.3
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-16 17:08:24 +02:00
Paul Holzinger 13dbce596d libnetwork/netavark: add plugin tests
The the plugin integration with the testplugin.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-04 18:20:18 +02:00
Paul Holzinger 8ff1bd975e libnetwork/netavark: add test plugin
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>
2023-04-04 18:20:18 +02:00
Daniel J Walsh 52854b61a1 Update list of codespell ignores
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-26 07:02:34 -04:00
Daniel J Walsh 4d74905a73 Vendor in latest containers/image
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-21 14:26:21 -05:00
Daniel J Walsh 24ea4f190b Update vendor of containers/(image, storage)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-11 14:33:42 -05:00
Valentin Rothberg e17483b871 bump to golangci-lint v1.50.0
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>
2022-10-17 15:03:07 +02:00
Giuseppe Scrivano 705b9aece4 Makefile: set go compat to 1.17
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-17 14:40:01 +02:00
Doug Rabson 951df0cd19 Only attempt CGO_ENABLED builds on Linux
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>
2022-05-09 11:14:43 +01:00
Kir Kolyshkin 4062726d59 Bump golangci-lint to 1.45.2
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>
2022-04-09 18:22:20 -07:00
Kir Kolyshkin 2c6b16d270 Makefile: simplify for modern Go
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>
2022-04-05 19:38:53 -07:00
Kir Kolyshkin 267411bed2 Create .codespellrc
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>
2022-03-30 11:39:49 -07:00
Daniel J Walsh 3e33e53044 Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-21 07:47:02 -05:00
Paul Holzinger 3026389ebc libnetwork: run unit tests
I totally forgot to check if the network unit tests even run CI, turns
out they are not.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-12 18:17:39 +01:00
Daniel J Walsh afa0ce74fc Run make build-cross in cirrus
Make sure to test non linux builds

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-18 05:58:44 -05:00
Daniel J Walsh 924a25ff41 Fix make cross
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-11 07:19:10 -05:00
Daniel J Walsh bab395ce80 Remove no_libsubid flag
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>
2021-08-10 13:20:10 -04:00
Daniel J Walsh 4c61660bf5 Switch default logdriver and eventslogger to journald, if root
This will fix hte eventslog and log files from growing huge,
Lets journald handling rolling logs.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-09 11:54:46 -04:00
dependabot[bot] 60893eef8d build(deps): bump github.com/containers/storage from 1.33.1 to 1.33.2
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.33.1 to 1.33.2.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.33.1...v1.33.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-06 10:14:41 -04:00
Valentin Rothberg a1ebba8263 set GOPROXY=https://proxy.golang.org
To make sure dependencies are resolved consistently across environments.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-08-02 15:02:52 +02:00
Valentin Rothberg 1398d585e4 pkg/config: fix systemd compile errors
The errors sneaked through CI as we didn't use the systemd build tag for
testing.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-27 13:49:55 +02:00
Valentin Rothberg 3b721f41df libimage: add unit tests
This adds tests pulling and a framwork that can be used to add more
tests in the future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-06 15:41:33 +02:00
Daniel J Walsh dee190ce4c Add support for codespell, and fix issues found
[NO TESTS NEEDED] This is just code cleanup

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-05-05 17:02:11 -04:00
Valentin Rothberg 32a28aee73 new libimage package
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>
2021-04-21 11:17:47 +02:00
Aleksa Sarai 4e485f45ab seccomp: add CI check for up-to-date seccomp.json
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-01-27 21:40:45 +11:00
naveen 69afcc3574 fix - make target all on osx
Fixes the make target all on osx.
2021-01-12 13:46:02 -05:00
Daniel J Walsh 79e8da1cbf Current code fails to compile on Darwin
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>
2021-01-05 13:46:11 -05:00
Sascha Grunert 5f1c701c68 Migrate seccomp/containers-golang
This migrates the repository from github.com/seccomp/containers-golang
into this library.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-27 10:15:31 +02:00
Sascha Grunert 7cad87d361 Update golangci-lint and add config
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>
2020-08-25 11:20:54 +02:00
Daniel J Walsh a3a0a08b50 Add support for Remote flags in containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-28 15:47:01 -04:00
Daniel J Walsh 7b97b08724 Do not validate paths on remote platforms
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>
2020-05-28 13:29:37 -04:00
Miloslav Trmač e624a2864a Fix (make vendor)
(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>
2020-04-08 17:28:34 +02:00
Daniel J Walsh b5b50e7035 Fix compiling on 32 bit machines
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-18 15:12:47 -04:00
Daniel J Walsh 863988d2af Update vendor of SELinux and containers/storage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-21 10:32:11 -05:00
Sascha Grunert 311b961e6f Add 32bit build to travis
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-04 13:22:10 +01:00
Daniel J Walsh 74d7f91c66 Update/Fix man page and fix several bugs in definition.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-03 13:57:01 -05:00
Qi Wang 9bb8e7e62b Add config package for containers.conf
This PR adds a package config for reading configurations from the containers.conf into the go struct.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-10-07 13:38:17 -04:00