Commit graph

431 commits

Author SHA1 Message Date
Daniel J Walsh f22791aec7
Handle hard links in remote builds
Fixes: https://github.com/containers/podman/issues/9893

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-05-22 05:27:03 -04:00
Jhon Honce 98955bedbc Break up python APIv2 tests
* Tests broken up into areas of concern
* Introduced fixtures to reduce duplicated code
* Introduced new assert methods with APITestCase
* General cleanup of code while visiting
* Tests now targeting quay.io

Known issues:
* is-official against quay.io not working

Fixes: #9238
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-05-18 08:39:35 -07:00
Daniel J Walsh bdbce9bcb1
Add documentation on short-names
Once we settle on the wording for short-names in podman-pull, I will
add the same section to all of the podman commands that use pull.

Also ran through all man pages with a spell checker.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-05-07 09:00:35 -04:00
Rob Cowsill 9731ecfc7a
[CI:DOCS] Restore missing content to manpages
The following content was omitted:
- Text after the first markdown link on a line to the end of the last
  (in lines with multiple markdown links)
- Email addresses of the form <a...@...>

Fixed by:
- Making the first two regexes match each link individually, instead
  of matching from the start of the first link to the end of the last
- Making the last regex specifically match <a> and </a> tags

Signed-off-by: Rob Cowsill <42620235+rcowsill@users.noreply.github.com>
2021-04-25 16:19:24 +01:00
Daniel J Walsh 9c8277247d
Fixes from make codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-21 13:16:33 -04:00
Wong Hoi Sing Edison 77159dbd0a
Update nix pin with make nixpkgs
Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2021-04-14 10:15:25 +08:00
Chris Evich b6b0b6e8bd
Overhaul Makefile binary and release worflows
* Incorporate changes from abandoned #9918: Use dedicated `bin`
  sub-directories for `windows` and `darwin` when building
  `podman-remote`.  The linux flavor remains under `bin` as before.

* Fix MacOS Documentation-generation for release-packaging.
  The `install-podman-remote-%-docs` target requires local execution
  of `podman-remote`, but it was assuming GOOS=linux.  Fix this
  by dynamically discovering the local OS/architecture type while
  still permitting cross-building of MacOS binaries under Linux.

* Unify temporary directory/file behavior to use a common template.
  In case of left-over temporary items left in the repository,
  update the `clean` target accordingly to remove them.

* Fix broken podman-remote-static and MacOS release archive targets
  mismatching the `podman-remote-%` target.  Disambiguate this target
  for all platforms by spelling each out in full, instead of using
  a wild-card recipe.

* Fix Windows-installer target to properly recognize existing
  output files and not constantly rebuild every time.

* Include the podman version number in the Windows-installer target
  in case a user downloads multiple releases.

* Include a subdirectory containing the podman version number for
  both `tar.gz` and `zip` targets.  This prevents users clobbering
  existing directories when un-archiving from releases.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:21:28 -04:00
Chris Evich a4686883b7
Reorganize Makefile with sections and guide
Over several years the podman Makefile has become a
bloated complex mess.  This impedes both debugging
and maintenance, besides causing general eye-strain.

Fix this by adding a simple navigation/layout guide, to help
developers quickly find what's needed. Re-organize the entire
file according to the new layout guide.  Add section headers
that call out the purpose of the encompassed content, and
are easy to locate with search-tools.

Note: No recipes or definitions have been altered by this
commit, only re-arranged.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:21:28 -04:00
Chris Evich 0e83851f08
Simplify Makefile help target
An in-line Python script, while flexible, is arguably
more complex and less stable than the long-lived `grep`,
`awk`, and `printf`.  Make use of these simple tools
to display a column-aligned table of target and description
help output.

Also, the first target that appears in a Makefile is considered
the default (when no target is specified on the command-line).
However, despite it's name, the `default` target was not listed
first.  Fix this, and redefine "default" target to "all" as
intended, instead of "help".

Lastly, add a small workaround for a vim syntax-hilighting bug.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:19:51 -04:00
Chris Evich 5a703bbf7a
Don't shell to obtain current directory
Instead of shelling out frequently to resolve the current
directory, use the Makefile built-in `$(CURDIR)`.  It has
the exact same meaning w/in the context of a `Makefile`.

Ref.:
https://www.gnu.org/software/make/manual/html_node/Quick-Reference.html

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:01:04 -04:00
Chris Evich 837bb9f492
Remove unnecessary/not-needed release.txt target
Previously this was needed for an automated release process.  That
automation has long since been removed.  Simplify the Makefile
by removing the target and references.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:01:04 -04:00
Chris Evich f28e9da45c
Bump go.sum + Makefile for golang 1.16
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-07 15:19:51 -04:00
Wong Hoi Sing Edison 6d98473945
[NO TESTS NEEDED] Update nix pin with make nixpkgs
- Bugfix `make nixpkgs` which pin with branch `nixos-20.09`
  - Code lint with `nixpkgs-fmt`
  - Code sync between x86\_64 and aarch64

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2021-04-06 21:52:00 +08:00
Morten Linderud 7801072851
Makefile: introduce install.docker-full
The split of install.docker and install.docker-docs makes some sense but
there should be some way to specify both for packagers.

This introduces `make install.docker-full` which installs both the
docker binary and the documentation.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-03-31 16:38:06 +02:00
Morten Linderud ab3b6df130
Makefile: ensure install.docker creates BINDIR
Commit 3908c00799 introduces a split for
installing the docker binary and the docker documentation. The
install line creating BINDIR and MANDIR was both moved to the
install.docker-docs path which makes `install.docker` fail.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-03-31 16:38:06 +02:00
Paul Holzinger 6a78fcaa0a Add powershell completions
Add support for generating powershell completion files. This is especially
useful for people using the podman remote client on windows.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-29 15:00:09 +02:00
Lokesh Mandvekar 61e626c859 Makefile: add install.docker-docs-nobuild for packaging use
This will allow installation of the manpages without the need to rebuild
them in the installation stage of distro packaging.

[NO TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2021-03-03 16:21:27 -05:00
Ming Liu ac992e4b02 Makefile: install systemd services conditionally
Only install systemd services provided that systemd is in BUILDTAGS.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-03-02 16:24:15 +01:00
Ming Liu 3908c00799 Makefile: split install.docker-docs from install.docker
This allows end users to be able to choose to not install any docs.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-03-02 13:20:41 +01:00
Valentin Rothberg 5dded6fae7 bump go module to v3
We missed bumping the go module, so let's do it now :)

* Automated go code with github.com/sirkon/go-imports-rename
* Manually via `vgrep podman/v2` the rest

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-22 09:03:51 +01:00
Matej Vasek 68133414f4 [NO TESTS NEEDED] Update linter
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-10 13:25:40 +01:00
Ed Santiago dfa9a340ad Makefile: make bin/* real targets!
Backstory: every time you run 'make podman' or even
just 'make', you get a full recompile. This is sub-ideal.

Cause: I don't really know. It looks complicated. #5017
introduced a .PHONY for bin/podman, for reasons not
explained in the PR. Then, much later, #5880 well-
intentionedly but improperly tweaked the 'find'
command used in defining SOURCES, adding a -prune
but without the corresponding and required -print.
Let's just say, it was an unfortunate cascade of events.

This PR fixes the SOURCES definition and removes the
highly-undesired .PHONY from podman & podman-remote,
making it so you can type 'make' and, oh joy, not
build anything if it's current. The way 'make' is
supposed to work.

Why fix this now? Because my PR (#9209) was failing in CI,
in the Validate step:

    Can't exec "./bin/podman": No such file or directory at hack/xref-helpmsgs-manpages line 223.

It failed even on Re-run, and only passed once I force-pushed
the PR (with no changes, just a new commit SHA). I have no idea
why bin/podman wasn't built, and I have zero interest in pursuing
that right now, but the proper solution is to add bin/podman as
a Makefile dependency for that particular test. So done.

While I'm at it, fix what is pretty clearly a typo in a .PHONY

And, finally, fix a go-md2man warning introduced in #9189

[NO TESTS NEEDED]

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-02-03 05:49:17 -07:00
Ed Santiago e9f936a29d Makefile: refactor ginkgo * ginkgo-remote
Create a new common target, ginkgo-run, with the main ginkgo
test incantation; ginkgo and ginkgo-remote now invoke that,
with a clearer distinction between their arguments.

Reason for this: 'make remoteintegration' was not generating
ginkgo logs in CI. Reason: '-debug' option was missing from
the ginkgo incantation. Reason: impossibility of maintaining
duplicate long-complicated lines. This PR distills the common
aspects, making the differences clearer between local & remote.

IMPORTANT NOTE: '-nodes 3' was also missing from remote ginkgo.
This PR adds it. If this was intentionally omitted, please let
me know (with reasons) so I can refactor that too.

[NO TESTS NEEDED]

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-02-02 09:25:44 -07:00
Ed Santiago ee8ee651d5 New 'make completions' target
Generate shell completion files for podman and podman-remote
and for all known shells (bash, fish, zsh). Fix Readme file
in completions dir: it suggested running 'make completion',
singular; no such target existed. Since the install target
is plural, I choose to make the new target plural also.

This is intended for use in CI some day, in a check such as:

  (in contrib/cirrus/runner.sh):

    make completions
    SUGGESTION="run 'make completions' and commit all changes" ./hack/tree_status.sh

The goal would be to make sure that any new podman subcommands
or flags are accompanied by their corresponding shell helpers
on all commits.

IT IS NOT POSSIBLE TO ENFORCE THIS NOW. As I understand it,
Cobra is slow to incorporate community PRs, so the podman team
has chosen to sneak in completion files generated by an
unreleased and un-vendored version of Cobra. Running 'make
completions' right now would clobber those and result in
a diminished user experience.

I'm submitting this anyway as a stepping-stone toward that
future day when we can create such a CI hook.

[NO TESTS NEEDED]

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-02-01 13:47:54 -07:00
Valentin Rothberg a3621a7cff Cirrus: add bindings checks
Make sure that bindings are in sync with the code.  The check is similar
to what's already being done with `make vendor`, so integrate the two.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-20 14:38:02 +01:00
Valentin Rothberg 41a7e11c7e make bindings generation explicit
Instead of implicitly generating the bindings, make it explicit, similar
to `make vendor`.  This should prevent redundant and possibly error
prone generations.  A following commit will shield CI.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-20 13:19:06 +01:00
Valentin Rothberg f302ce578b make bindings generation more robuts
The Go gods did not shine upon us trying to understand what's going on
in #9000.  The symptom is that `go generate` did not add required
imports to a generated file, ultimately breaking subsequent compilation.

While it still remains unclear *why* Go is behaving like that, the
symptom disappears when `go generate` runs in module mode; that is
without `-mod=vendor` and without `GO111MODULE=off`.  This was
reproducible on two separate machines (Ubuntu and Fedora).

Also, when facing an unset GOPATH, set it to Go's default (i.e.,
$HOME/go) and make sure that GOBIN is in PATH since `goimports`
is required by `go generate`.

Fixes: #9000
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-20 13:19:06 +01:00
OpenShift Merge Robot 7d024a2fc8
Merge pull request #9031 from vrothberg/revert-ginkgo
Revert "ginkgo: install on demand via `go get -u`"
2021-01-20 07:17:23 -05:00
OpenShift Merge Robot 54c465bda6
Merge pull request #8911 from edsantiago/prs_must_include_tests
CI: smoke test: insist on adding tests on PRs
2021-01-20 05:57:09 -05:00
Valentin Rothberg 175fc3867a Revert "ginkgo: install on demand via go get -u"
This reverts commit de05e58168.

Running `go get -u` will change the local Go module causing CI to fail
as the local git tree is being changed.  Reverting the change for now
until we have a better idea.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-20 10:31:24 +01:00
Ed Santiago 37abec240a [CI:DOCS] fix go-md2man HTMLSpan warnings
I'm tired of seeing these every time I run 'make':

   WARNING: go-md2man does not handle node type HTMLSpan

Cause: left-angle-brackets ( < ) in document source

Solution:
  1) backquote-escape those that need to be shown, usually
     ones referring to an argument or email address; or
  2) Actual HTML ( <sup> and <a> ) which are meant to be
     shown in generated HTML docs but can't be shown in
     man pages, we filter out via a sed expression.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-01-19 12:59:03 -07:00
Ed Santiago 9f6bb3563d CI: smoke test: insist on adding tests on PRs
On each PR (with a few exceptions), check the list of git-touched
files, and abort if no tests are added. Include instructions
on how to bypass the check if tests really aren't needed.

Include a hardcoded exception list for PRs that only touch a
well-known subset of "safe" files: docs, .cirrus.yml, vendor,
version, hack, contrib, or *.md. This list is likely to need
tuning over time.

Add a test suite, but not one recognized by the new script
(because it's a "*.t" file), so: [NO TESTS NEEDED]

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-01-19 10:45:58 -07:00
Valentin Rothberg de05e58168 ginkgo: install on demand via go get -u
Install ginkgo on demand via `go get -u` rather than keeping a copy it's
entire source code in the vendor dirctory.  The main motivation for that
is to make `golangci-lint` happy which is continuously throwing up on
the import of a program (i.e., ginkgo).  The linter is broken and stupid
as it ignores flags to ignore dirs and ignores build tags (at least some
linters do) which is blocking us from updating to newer versions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-19 10:00:53 +01:00
Valentin Rothberg 2df59829e4 simplify bindings generation
Run `go generate ./pkg/bindings/...` once for all bindings instead of
generating them separately.  This should speed up bindings generation
as a given package is visited only once, and it fixes #8989 by dropping
the use of pushd and popd.

Fixes: #8989
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-17 17:24:03 +01:00
Valentin Rothberg 4629942686 make: generate bindings: use vendor
Set `-mod=vendor` when generating the bindings.  We expect all
dependencies to be vendored already.  This should slightly speed
up the bindings generation and prevent redundant network accesses.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-17 17:24:01 +01:00
Matthew Heon f781efd2dc Add tests for volume plugins
This involves a new test binary (a basic implementation of the
volume plugin protocol) and a new image on quay.io (Containerfile
to produce it and all sources located in this commit). The image
is used to run a containerized plugin we can test against.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-01-14 16:43:23 -05:00
Valentin Rothberg d498ef53aa
Makefile: add target to generate bindings
Add a `.generate-bindings` make target that only runs in the absence of
the `.generate-bindings` file or when a `types.go` file below
`pkg/bindings` has changed.

This will regenerate the go bindings and make sure the code is up2date.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-14 11:54:57 -05:00
Chris Evich 1d8b9e944f
Cirrus: Add cross-compile test for alternative arches
Followup to https://github.com/containers/podman/pull/8907 that simply
ensures cross-compiling podman completes.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-11 13:46:37 -05:00
Paul Holzinger 65c88ec473 Add mips architecture to the cross build target
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-07 15:04:40 +01:00
Josh Soref 4fa1fce930 Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-12-22 13:34:31 -05:00
Wong Hoi Sing Edison 0599b21857
Update nix pin with make nixpkgs
This PR introduce 3 changes:

  - Upgrade Nix stable channel from 20.03 to 20.09.

    NixOS 20.09 released at 2020-10-27, see
    <https://nixos.org/manual/nixos/stable/release-notes.html#sec-release-20.09>
    for more information.

  - Replace `git` with `gitMinimal`.

    All 6 projects (i.e. crun/conmon/skopeo/buildah/podman/cri-o) are
    having `git` as dependency for failsafe during bootstrap. BTW
    <https://github.com/NixOS/nixpkgs/pull/104896> replace `asciidoc`
    with `asciidoctor` so trigger the dependency chain to `glib` and so
    failed (see below). Switching to `gitMinimal` skip this dependency
    chain to `glib`, which also speed up overall build process.

  - Adding `-pthread` for `glib`

    `conmon` couldn't skip the error by replacing `git` with
    `gitMinimal` since it do depend on `glib`. Since `glib` trigger
    error message "undefined reference to 'pthread\_create'", therefore
    adding `pthread` to `CFLAGS` could solve the problem.

Also see:

  - <https://github.com/containers/crun/pull/550>
  - <https://github.com/containers/conmon/pull/218>
  - <https://github.com/containers/skopeo/pull/1120>
  - <https://github.com/containers/buildah/pull/2831>
  - <https://github.com/containers/podman/pull/8526>
  - <https://github.com/cri-o/cri-o/pull/4395>

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2020-12-20 18:41:22 +08:00
OpenShift Merge Robot 4b5cb7b1de
Merge pull request #8534 from Luap99/revert-Luap99-cobra-vendor
Revert the custom cobra vendor
2020-12-01 21:39:50 +01:00
Paul Holzinger 3d4a0e42b3 Revert the custom cobra vendor
Vendor in the latest cobra release v1.1.1

This will hurt the completion experience but is required for
proper packaging, see: #8528.

The best solution is to keep the current scripts since they
work fine with cobra v1.1.1.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-12-01 14:15:18 +01:00
Daniel J Walsh f62a356515
Remove varlink support from Podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-26 16:50:42 -05:00
OpenShift Merge Robot 2993e97dec
Merge pull request #6442 from Luap99/podman-autocomplete
Shell completion
2020-11-13 16:46:51 +01:00
Daniel J Walsh a7431003b8
Fix issues found with codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-12 13:37:38 -05:00
Paul Holzinger ae3816614d Install the new shell completion logic
Add a new make target (completion) to generate the shell
completion scripts. This will generate the scripts for bash,
zsh and fish for both podman and podman-remote with `podman completion`.
The scripts are put into the completions directory and can be
installed system wide with `sudo make install.completions`.

This commit replaces the current handwritten scripts for bash and zsh.

The `validate.completion` target has been adjusted to make sure nobody
edits these scripts directly.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 11:40:29 +01:00
Ed Santiago b0601cb34a [CI:DOCS] Restore man page cross-checker
Somewhere in the CIv2 migration we lost the man page vs --help
cross-checker. Add it back, by adding it into the man-page-check
Makefile target; this is part of 'make validate', which is run
in CI even on CI:DOCS PRs.

As happens when CI doesn't run, things broke. Man pages got out
of sync with --help. This PR:

 1) Fixes hack/xref-helpmsgs-manpages to deal with the new
    "Options" (instead of "Flags") form of podman help. #8034
    did part of that, but one of my review comments was
    accidentally left out.

 2) Fixes hack/xref-helpmsgs-manpages to deal with the new
    option syntax in man pages, post- #8292, in which each
    option is preceded by four hashes so as to make them
    HTML <h4> elements with named anchors.

 3) Fixes man pages that #8292 accidentally missed.

 4) Adds man page entries for two flags that got added
    to podman but not documented (pod create --network-alias,
    play kube --log-driver)

Fixes: #8296

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-11-11 08:31:30 -07:00
Jhon Honce 2d50ec6996 Update CI tests to run python docker library against API
* Update reference to docker-py to docker to reflect change in library
  name
* Update tests to create storage sandbox
* Enable all tests that endpoints support
* Refactor containers/{id}/rename to return 404 not 500
* Refactor tests to use quay.io vs. docker.io

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-11-09 10:45:54 -07:00
Daniel J Walsh 3daef2e826
Use /tmp/podman-run-* for backup XDG_RUNTIME_DIR
We need to block systemd from cleaning up this directory
by dropping a /usr/lib/tmpfiles.d/podman.conf file in place.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-04 15:32:00 -05:00