16 Commits

Author SHA1 Message Date
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
ba1d8ad2af enable linting on v2
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-25 14:16:56 -05:00
593eb7625a golangci: enable goimports
Enable the goimports linter and fix reports.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-05 20:03:44 +01:00
a102869746 .golangci.yml: move swagger.go from Makefile
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 09:54:48 +01:00
4533dea70e make lint: include docs/
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 09:54:48 +01:00
4fb24ab145 make lint: include pkg/tracing
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 09:54:48 +01:00
67165b7675 make lint: enable gocritic
`gocritic` is a powerful linter that helps in preventing certain kinds
of errors as well as enforcing a coding style.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:27:02 +01:00
270d892c3d linter: blacklist linters instead of whitelisting
Blacklist linters instead of whitelisting them.  This way, we will
benefit from new linters when updating and it's easier to actually
find and fix open issues.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:27:02 +01:00
eeb61427bb bump golangci-lint to 1.18.0
The latest versions have regressions in --skip-dirs where some linters
will still run and error out.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:27:02 +01:00
2046be6ae0 build: drop support for ostree
it is going to be removed from containers/image as well, so no longer
depend on it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-30 11:28:10 +01:00
db826d5d75 golangci-lint round #3
this is the third round of preparing to use the golangci-lint on our
code base.

Signed-off-by: baude <bbaude@redhat.com>
2019-07-21 14:22:39 -05:00
23602de816 Revert "Switch to golangci-lint"
Signed-off-by: baude <bbaude@redhat.com>
2019-04-05 20:09:45 -05:00
023eba20db Add varcheck linter
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 09:07:05 +02:00
81a4451fea Add deadcode linter
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 09:07:05 +02:00
42830ab711 Update lint to use golangci-lint
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 09:06:32 +02:00