Commit graph

131 commits

Author SHA1 Message Date
Chris Evich 34043bd81d
Fix Error, empty output for info: 'VERSION'
When building releases, the definitive canonical version of podman (or
podman-remote) is needed.  Previously this was accomplished by scraping
`version/version.go`.  However, due to tooling differences across
platforms, this has proven problematic, unreliable, and hard to
maintain.

Fix this by building and caching a small golang binary who's only purpose
is to print the version number to stdout.  This not only provides a quick
and reliable way to determine the current version, it also acts as a check
on the version API vs tooling that relies on it.

Lastly, remove several `RELEASE_*` Makefile definitions which aren't
actually used anywhere.  These were originally added a very long time
ago to serve as part of a long since retired release process.  The
remaining items, were updated to make use of the new `.podmanversion`
binary on an as-required basis (i.e. not every time `make` is run).

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-09-21 12:29:26 -04:00
Daniel J Walsh 613ef220f3
Fix up build the docs site
[NO TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-16 17:41:00 -04:00
jesperpedersen 0d1ba0a58f Remove changelog.txt from the repository
The changelog.txt file hasn't been kept in sync with release tags,
especially on main, so remove it.

The release notes will be featured in RELEASE_NOTES.md.

Signed-off-by: jesperpedersen <jesper.pedersen@redhat.com>

[NO TESTS NEEDED]
2021-09-07 10:53:26 -04:00
Daniel J Walsh db60a1e654
Add support for libsubid
This will enable remote access to /etc/subuid and /etc/subgid
information from ldap services, if shadow-utils ships with a libsubid.

[NO TESTS NEEDED] Since we have no way to test this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-27 08:13:01 -04:00
Jhon Honce e88b62b34b Fix swagger issue
Add special case for op PlayKubeDownLibpod Heuristic for guessing swagger operation id too limited for PlayKubeDownLibpod

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-08-25 15:50:55 -05:00
Ed Santiago 03ffba29a2 podman-registry: minor usability updates
1) use cached quay.io image
 2) use 'podman unshare' when rm -rf'ing, to avoid EPERM

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-08-02 14:01:47 -06:00
Chris Evich 40ef17ac28
Cirrus: Fixes due to master->main rename
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-06-30 11:39:19 -04:00
Matthew Heon 8f3605e7d6 Add script for identifying commits in release branches
One of the worst parts of a Podman release is writing the release
notes. It requires manually going through all merged commits
since the last release, figuring out what was actually done, and
writing a small blurb about what was fixed. The worst part of
this is the difficulty in finding the commits that were actually
included in previous releases - our extensive backports to prior
releases mean that there are usually dozens of commits that were
included in a prior release, but do not have a matching SHA (as
the original author did not do the backport, and often the commit
required massaging to cherry-pick in).

This script automates the job of finding commits in one release
branch that are not in another, with filtering to remove most
cherry-picked commits. It makes my life a lot easier during
releases, so I figured I'd include it in hack/ so anyone else
stuck with the enjoyable task of writing release notes can have a
slightly easier life.

The script is written in absolutely terrible Ruby and its
performance is absolutely terrible, but you only need to run it
once per major release and a 30-second wait to generate the list
of commits to include isn't bad.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-05-17 16:40:35 -04:00
Ed Santiago b18931cef3 [CI:DOCS] hack/bats - new helper for running system tests
Well, new to you. It's been something I've used for years.
Simple, but it takes care of a lot of housekeeping, and
makes it ever-so-much-more pleasant to invoke bats tests.
And when it's easier to run tests, tests get run.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-05-11 16:31:56 -06:00
Paul Holzinger 30e731ecc8 Revert escaped double dash man page flag syntax
Commit 800a2e2d35 introduced a way to disable the conversion of `--`into
an en dash on docs.podman.io, so the ugly workaround of escaping the
dashes is no longer necessary.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-05-07 18:30:00 +02: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 e296b6023e
Fix incorrect version number output
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:01:03 -04:00
Tom Deseyn 4ceed6eb2f Update swagger-check
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
2021-04-07 15:26:24 +02:00
Ed Santiago daab9658f8 [CI:DOCS] swagger-check: compare operations
Until now we've only compared operations when called with the
non-default --pedantic flag, because there were way too many
exceptions.

With the merge of #9944 the rules have become much cleaner.
Still not perfect, but it's now possible to have simple
general rules with a (semi-)manageable list of exceptions.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-04-06 11:36:38 -06:00
OpenShift Merge Robot a0873b6650
Merge pull request #9953 from jwhonce/wip/operation_id
[CI:DOCS] Polish swagger OperationIDs
2021-04-06 13:31:56 -04:00
Jhon Honce 51b23be38b [CI:DOCS] Polish swagger OpertionIDs
Renamed 4 IDs to be consistent with other endpoints.

Fixes #9951

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-06 10:10:54 -07:00
Chris Evich 804da7ca07
Cirrus: Make use of shared get_ci_vm container
Depends on:
    https://github.com/containers/automation_images/pull/57
    https://github.com/containers/automation/pull/64
    https://github.com/containers/automation/pull/66
    https://github.com/containers/automation/pull/67
    https://github.com/containers/automation/pull/68

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-05 15:38:04 -04:00
Ed Santiago cc0bcea4ea manpage xref: helpful diagnostic for unescaped dash-dash
PR #9856 works around a buggy markdown processor that cleverly
converts double dashes to em-dash. The unfortunate result is
that the man page source files are unmaintainable, because
every '--foo' has to be specified as '\-\-foo'. This is
impossible for humans to remember, so let's add a helpful
diagnostic message when we detect new options added without
the escapes.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-29 13:00:11 -06:00
Paul Holzinger bc48211924 Fix long option format on docs.podman.io
Escape the two dashes, otherwise they are combined into one long dash.
I tested that this change is safe and still renders correctly on github
and with the man pages.

This commit also contains a small change to make it build locally.
Assuming you have the dependencies installed you can do:
```
cd docs
make html
```
Preview the html files in docs/build/html with
`python -m http.server 8000 --directory build/html`.

Fixes containers/podman.io#373

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-29 14:38:25 +02:00
Daniel J Walsh c9ef260710
Document CONTAINERS_CONF/CONTAINERS_STORAGE_CONF Env variables
Also Switch to using CONTAINERS_REGISTRIES_CONF for registries.conf
overrides.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-10 06:34:47 -05: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
Chris Evich bfc1b66be1
Cirrus: Fix running Validate task on branches
Followup to dbb9943

Despite skipping the `Smoke` check, it was observed on a *new* branch,
the `validate` task (specifically `git-validation`) will fail.  This
is because:

* `$CIRRUS_LAST_GREEN_CHANGE` will be empty on a new branch.
* `$CIRRUS_BASE_SHA` is always empty for runs triggered by branch-push
* `$EPOCH_TEST_COMMIT` will be set to `YOU_FOUND_A_BUG`.

Fix this by eliminating the `Smoke` task entirely, simplifying all
the `make validate` operations into the `validate` cirrus task.  Ensure
this task does not run when a new branch or tag is pushed.

Also, eliminate the `$CIRRUS_BUILD_ID` value as it's confusing and not
actually used anywhere.  It was formerly used for building VM images,
but this has moved to another repo entirely.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-27 10:35:27 -05:00
Valentin Rothberg caaaa2c5e1 hack/install_golangci.sh: smarter install
Detect if the installed version of golangci-lint is outdated and update
it if needed.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-17 17:15:23 +01:00
Valentin Rothberg 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
Chris Evich ec309504c4
[CI:DOCS] Add hook-script example to get_ci_vm.sh
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-14 14:26:36 -05:00
Josh Soref 4fa1fce930 Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-12-22 13:34:31 -05:00
Jhon Honce e55320efde hack/podman-socat captures the API stream
* verify socat and podman binaries exist
* setup a sandboxed podman service
* run podman service with socat proxy to capture API stream
* clean up sandbox leaving the log files for review

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-02 16:03:56 -07: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
Jhon Honce b59465d1cc Fix sed regex to update version in version/version.go
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-11-18 15:21:26 -07:00
OpenShift Merge Robot 2993e97dec
Merge pull request #6442 from Luap99/podman-autocomplete
Shell completion
2020-11-13 16:46:51 +01:00
OpenShift Merge Robot 2fc2d4643e
Merge pull request #8316 from rhatdan/codespell
Fix issues found with codespell
2020-11-12 23:29:51 +01:00
Paul Holzinger f5a2e578eb Maintain consistent order of short and long flag names in docs
Make the order of short and long flag names in the documentation
consistent. Also adjust the man page validaten script to only allow
the `**--long**, **-s**` syntax.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 21:46:17 +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 b5d1d89a37 Add shell completion with cobra
Allow automatic generation for shell completion scripts
with the internal cobra functions (requires v1.0.0+).

This should replace the handwritten completion scripts
and even adds support for fish. With this approach it is
less likley that completions and code are out of sync.

We can now create the scripts with
- podman completion bash
- podman completion zsh
- podman completion fish

To test the completion run:
source <(podman completion bash)

The same works for podman-remote and podman --remote and
it will complete your remote containers/images with
the correct endpoints values from --url/--connection.

The completion logic is written in go and provided by the
cobra library. The completion functions lives in
`cmd/podman/completion/completion.go`.

The unit test at cmd/podman/shell_completion_test.go checks
if each command and flag has an autocompletion function set.
This prevents that commands and flags have no shell completion set.

This commit does not replace the current autocompletion scripts.

Closes #6440

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 11:38:31 +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
Marcel Bargull 06d2d0c6ef Use CPP, CC and flags in dep check scripts
Allow build systems without standard cc to successfully run the
dependency checking helper scripts from the Makefile.
This supports custom compilers specified by the common CC environment
variable, preprocessors given as CPP and additional preprocessor flags
from CPPFLAGS.
Additional flags from CFLAGS and LDFLAGS are considered for compiling/linking.
Overall, this facilitates cross-compilation and similar setups.

Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
2020-11-06 10:44:27 +01:00
Daniel J Walsh 980b1e87d4
Switch use of Flags to Options
Want to have man pages match commands, since we have lots of printed
man pages with using Options, we will change the command line to use
Options in --help.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 08:37:57 -04:00
Chris Evich 5b7c64cc97
Cirrus: Fix obtaining a CI VM
Also removed automatic exection of setup_environment.sh since most
people using this script are podman developers (not automation/CI
folks).  If executing the automation scripts is necessary, manual
attendance to required variables like `$TEST_FLAVOR` is mandatory.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-07 15:29:43 -04:00
OpenShift Merge Robot 0a46b9c9e6
Merge pull request #7696 from jwhonce/wip/version
Refactor version handling in cmd tree
2020-09-21 13:23:20 +00:00
Jhon Honce c4b49afad3 Refactor version handling in cmd tree
* Move from simple string to semver objects
* Change client API Version from '1' to 2.0.0

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-18 15:13:58 -07:00
Jordan Christiansen d20a37bf10 Install bats as root
Installing bats to /usr/local requires root privileges. Without this,
`make install.tools` fails. However, if I do `sudo make install.tools`,
then all of the other dependencies and git clones in the current
directory end up owned by root. This limits root privileges to the part
that needs it.

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-09-18 12:50:25 -05:00
Daniel J Walsh 526f01cdf5
Fix up errors found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-11 06:14:25 -04:00
Paul Holzinger b4adc17614 [CI:DOCS] fix swagger api docs
Separate the volume endpoints into compat and libpod,
as it is done for the other endpoints.

Move the libpod image push endpoint to images.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-23 15:10:22 +02:00
Sascha Grunert 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
Ed Santiago 8e11a825e1 Cross-reference *.rst files too
There are a bunch of *.rst files in docs/source, linking sometimes
to man pages and sometimes to other .rst files. These files each
have entries of the following form:

   :doc:`foo <link-to-foo>` Description of foo

...for all podman sub and sub-subcommands 'foo'.

Read all .rst files and make sure that:

  - all entries in a given file are in alphabetical order
  - all link-to-foo targets point to existing doc files
  - every subcommand known by 'podman help' has a corresponding
    doc entry in a .rst file

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-11 08:03:37 -06:00
Ed Santiago ca893b8329 Man pages: assert that subcommands are in order
For each podman*.md file with a subcommand table (podman,
podman-container, etc), assert that the subcommand list
is sorted.

Change is bigger than it should be, because it switches from
nice clean local per-function error counting to using a nasty
global.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-11 07:49:10 -06:00
Daniel J Walsh a5e37ad280
Switch all references to github.com/containers/libpod -> podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 08:23:45 -04:00
Jhon Honce 964d3300c6 [WIP] Refactor podman system connection
* Add support to manage multiple connections
  * Add connection
  * Remove connection
  * Rename connection
  * Set connection as default
  * Add markdown/man pages
* Fix recursion in hack/xref-helpmsgs-manpages

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-07-22 15:25:44 -07:00
Valentin Rothberg d628de31d7 unit tests: root check
The unit tests currently require running as root.  This has caused some
confusion that justifies adding a root check to `make localunit` and
error out for non-root users instead of starting the tests deemed to
fail.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-21 13:31:43 +02:00