14 Commits

Author SHA1 Message Date
d44bafc3c4 Reimplement lint with improved compatibility
Specifically, Darwin's bash is very old so it doesn't support newer
features like `declare -A`.  Reduce the complexity of the script
so that it can be used for all platforms.  Comment heavily regarding the
scripts various execution contexts to prevent developers relying on
advanced features for any future modifications.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-02-06 16:28:38 -05:00
d9ad7cbc94 Run lint for mac builds
There are darwin-specific code paths which were not being linted prior
to this commit.  Fix this with a new, darwin-specific section of the lint
runner script.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-02-01 09:49:53 -05:00
f9aba28ca7 make golangci-lint happy
First do not lint pkg/domain/infra/abi with the remote tag as this is
only local code.

Then mark the cacheLibImage field as unused, this should be an unused
stub for the remote client so that we do not leak libimage.
The linter sees that with the remote tag so we need to silence that
warning.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-09-14 11:21:00 +02:00
c7827957a4 ginkgo: restructure install work flow
- move the ginkgo deps into test/tools which is more consitent with the
  other tools there, listing in dependencies always causes errors with
  linters
- do not install it globally on the system, instead we use it in a
  subdir of this project

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-11-25 14:41:43 +01:00
ee35ce86d0 enable linter for pkg/machine/e2e
Rename all files to _test.go and rename the package to e2e_test. This
makes the linter less strict about things like dot imports.

Add some unused nolint directives to silence some warnings, these can be
used to find untested options so someone could add tests for them.

Fixes #14996

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 18:04:10 +02:00
1b62e45438 golangci-lint: add systemd build tag
Lint the systemd code and fix the reported problems.
The remoteclient tag is no longer used so I just removed it.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-14 15:28:45 +02:00
833456e079 Add podman machine test suite
This PR introduces a test suite for podman machine.  It can currently be
run on developers' local machines and is not part of the official CI
testing; however, the expectation is that any work on machine should
come with an accompanying test.

At present, the test must be run on Linux.  It is untested on Darwin.
There is no Makefile target for the test.  It can be run like `ginkgo -v
pkg/machine/test/.`.  It should be run as a unprivileged user.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-04-25 13:05:35 -05:00
68133414f4 [NO TESTS NEEDED] Update linter
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-10 13:25:40 +01:00
f38b7f48cc golangci-lint: install to ./bin
Install golangci-lint to `./bin` instead of `$GOBIN`.  The latter may be
shared with other projects who require a different version.  Having a
shared version of golangci-lint is a reoccurring source of red herrings
on my work station, so I think it's time to split them.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-17 17:07:04 +01:00
f62a356515 Remove varlink support from Podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-26 16:50:42 -05:00
ba9f18e2b8 Use bash binary from env instead of /bin/bash for scripts
It's not possible to run any of the scripts on distributions which do
have `bash` not in `/bin`. This is being fixed by using `/usr/bin/env
bash` instead.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-17 10:42:23 +02:00
9263ed2ab1 Remove use of ABISupport buildtag
We need to default to building podman. If you specify no build
tags you will not build podman, not podman-remote.

Just using remote flag to indicate podman-remote and !remote for
podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-03 15:11:34 -04:00
09dc701097 podman rmi: refactor logic
While this commit was initially meant to fix #5847, it has turned into a
bigger refactoring which I did not manage to break into smaller pieces:

 * Fix #5847 by refactoring the image-removal logic.

 * Make the api handler for image-removal use the ABI code. This way,
   both (i.e., ABI and Tunnel) end up using the same code.  Achieving
   this code share required to move some code around to prevent circular
   dependencies.

 * Everything in pkg/api (excluding pkg/api/types) must now only be
   accessed from code using `ABISupport`.

 * Avoid imports from entities on handlers to prevent circular
   dependencies.

 * Move `podman system service` logic into `cmd` to prevent circular
   dependencies - it depends on pkg/api.

 * Also remove the build header from infra/abi files.  It will otherwise
   confuse swagger and other tools; errors we cannot fix as go doesn't
   expose a build-tag env variable.

Fixes: #5847
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-21 08:12:25 +02:00
e0847f5457 V2 podman system service
* Added support for system service
* Enabled linting on the varlinkapi source, needed to support V2
  service command
* Added support for PODMAN_SOCKET

Skip linting deprecated code

Rather than introduce bugs by correcting deprecated code, linting the
code is being skipped. Code that is being ported into V2 is being
checked.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-07 19:22:10 -07:00