summaryrefslogtreecommitdiff
path: root/hack
Commit message (Collapse)AuthorAge
* Simplify Makefile help targetChris Evich2021-04-12
| | | | | | | | | | | | | | | | | | 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>
* Fix incorrect version number outputChris Evich2021-04-12
| | | | Signed-off-by: Chris Evich <cevich@redhat.com>
* Update swagger-checkTom Deseyn2021-04-07
| | | | Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
* [CI:DOCS] swagger-check: compare operationsEd Santiago2021-04-06
| | | | | | | | | | | | 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>
* Merge pull request #9953 from jwhonce/wip/operation_idOpenShift Merge Robot2021-04-06
|\ | | | | [CI:DOCS] Polish swagger OperationIDs
| * [CI:DOCS] Polish swagger OpertionIDsJhon Honce2021-04-06
| | | | | | | | | | | | | | | | Renamed 4 IDs to be consistent with other endpoints. Fixes #9951 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Cirrus: Make use of shared get_ci_vm containerChris Evich2021-04-05
|/ | | | | | | | | | | 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>
* manpage xref: helpful diagnostic for unescaped dash-dashEd Santiago2021-03-29
| | | | | | | | | | | | 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>
* Fix long option format on docs.podman.ioPaul Holzinger2021-03-29
| | | | | | | | | | | | | | | | | | | 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>
* Document CONTAINERS_CONF/CONTAINERS_STORAGE_CONF Env variablesDaniel J Walsh2021-03-10
| | | | | | | Also Switch to using CONTAINERS_REGISTRIES_CONF for registries.conf overrides. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* bump go module to v3Valentin Rothberg2021-02-22
| | | | | | | | | 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>
* [NO TESTS NEEDED] Update linterMatej Vasek2021-02-10
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* Cirrus: Fix running Validate task on branchesChris Evich2021-01-27
| | | | | | | | | | | | | | | | | | | | | | 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>
* hack/install_golangci.sh: smarter installValentin Rothberg2021-01-17
| | | | | | | Detect if the installed version of golangci-lint is outdated and update it if needed. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* golangci-lint: install to ./binValentin Rothberg2021-01-17
| | | | | | | | | 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>
* [CI:DOCS] Add hook-script example to get_ci_vm.shChris Evich2021-01-14
| | | | Signed-off-by: Chris Evich <cevich@redhat.com>
* SpellingJosh Soref2020-12-22
| | | | Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* hack/podman-socat captures the API streamJhon Honce2020-12-02
| | | | | | | | | * 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>
* Remove varlink support from PodmanDaniel J Walsh2020-11-26
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Fix sed regex to update version in version/version.goJhon Honce2020-11-18
| | | | Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Merge pull request #6442 from Luap99/podman-autocompleteOpenShift Merge Robot2020-11-13
|\ | | | | Shell completion
| * Add shell completion with cobraPaul Holzinger2020-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #8316 from rhatdan/codespellOpenShift Merge Robot2020-11-12
|\ \ | | | | | | Fix issues found with codespell
| * | Fix issues found with codespellDaniel J Walsh2020-11-12
| |/ | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* / Maintain consistent order of short and long flag names in docsPaul Holzinger2020-11-12
|/ | | | | | | | 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>
* [CI:DOCS] Restore man page cross-checkerEd Santiago2020-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Use CPP, CC and flags in dep check scriptsMarcel Bargull2020-11-06
| | | | | | | | | | | | 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>
* Switch use of Flags to OptionsDaniel J Walsh2020-10-21
| | | | | | | | 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>
* Cirrus: Fix obtaining a CI VMChris Evich2020-10-07
| | | | | | | | | 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>
* Merge pull request #7696 from jwhonce/wip/versionOpenShift Merge Robot2020-09-21
|\ | | | | Refactor version handling in cmd tree
| * Refactor version handling in cmd treeJhon Honce2020-09-18
| | | | | | | | | | | | | | * 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>
* | Install bats as rootJordan Christiansen2020-09-18
|/ | | | | | | | | | 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>
* Fix up errors found by codespellDaniel J Walsh2020-09-11
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* [CI:DOCS] fix swagger api docsPaul Holzinger2020-08-23
| | | | | | | | | 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>
* Use `bash` binary from env instead of /bin/bash for scriptsSascha Grunert2020-08-17
| | | | | | | | 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>
* Cross-reference *.rst files tooEd Santiago2020-08-11
| | | | | | | | | | | | | | | | | | | 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>
* Man pages: assert that subcommands are in orderEd Santiago2020-08-11
| | | | | | | | | | | | 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>
* Switch all references to github.com/containers/libpod -> podmanDaniel J Walsh2020-07-28
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* [WIP] Refactor podman system connectionJhon Honce2020-07-22
| | | | | | | | | | | | * 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>
* unit tests: root checkValentin Rothberg2020-07-21
| | | | | | | | | 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>
* move go module to v2Valentin Rothberg2020-07-06
| | | | | | | | | | | | | | | With the advent of Podman 2.0.0 we crossed the magical barrier of go modules. While we were able to continue importing all packages inside of the project, the project could not be vendored anymore from the outside. Move the go module to new major version and change all imports to `github.com/containers/libpod/v2`. The renaming of the imports was done via `gomove` [1]. [1] https://github.com/KSubedi/gomove Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Docs: consistency between man / --helpEd Santiago2020-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New functionality in hack/man-page-checker: start cross- referencing the man page 'Synopsis' line against the output of 'podman foo --help'. This is part 1, flag/option consistency. Part 2 (arg consistency) is too big and will have to wait for later. flag/option consistency means: if 'podman foo --help' includes the string '[flags]' in the Usage message, make sure the man page includes '[*options*]' in its Synopsis line, and vice-versa. This found several inconsistencies, which I've fixed. While doing this I realized that Cobra automatically includes a 'Flags:' subsection in its --help output for all subcommands that have defined flags. This is great - it lets us cross-check against the usage synopsis, and make sure that '[flags]' is present or absent as needed, without fear of human screwups. If a flag-less subcommand ever gets extended with flags, but the developer forgets to add '[flags]' and remove DisableFlagsInUseLine, we now have a test that will catch that. (This, too, caught two instances which I fixed). I don't actually know if the new man-page-checker functionality will work in CI: I vaguely recall that it might run before 'make podman' does; and also vaguely recall that some steps were taken to remedy that. Signed-off-by: Ed Santiago <santiago@redhat.com>
* CI: force registry:2.6Valentin Rothberg2020-06-19
| | | | | | | | | | | For using the `registry:2.6` image. 2.7 and beyond dropped the `htpasswd` binary from the rootfs which parts of our CI depends on. While this is not a sustainable solution (assuming `htpasswd` is gone for ever), it unblocks the CI for now. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* force bats version to v1.1.0Valentin Rothberg2020-06-08
| | | | | | | | We experienced regression when using the latest `v1.2.0-dev` bats in Ubuntu 20.04 (see github.com/containers/libpod/pull/6418). Using bats v1.1.0 worked in the Ubuntu test VM. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Remove use of ABISupport buildtagDaniel J Walsh2020-06-03
| | | | | | | | | | 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>
* podman-registry: many unrelated fixesEd Santiago2020-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) fix lost credentials. must_pass(), added in #6375, eats the credentials generated via 'podman run --entrypoint htpasswd'. Run that podman instance directly, and add explicit error check. (The error and stdout/stderr handling here has gotten cumbersome. There must be something I'm missing that could make it all simpler.) 2) fix default podman path. When setting $PODMAN, default to the locally built one -- there may not be one in $PATH (e.g. in Ubuntu, see #6366). This in turn requires us to: 3) run registry test in integration, not unit test It looks like unit tests run before podman is built, causing a chicken-egg dilemma. Try to solve that by running the new hack/podman-registry-go test in integration tests, not unit tests. Signed-off-by: Ed Santiago <santiago@redhat.com>
* podman-registry helper script: handle errorsEd Santiago2020-05-24
| | | | | | | | | | | | | | | | | | | | | | | My initial revision of the podman-registry helper script was written in haste, with an enormous tradeoff: no visibility into any errors. We are now paying for this in #6366: the script is failing on Ubuntu and we have no way of knowing why. This PR adds a must_pass() function used for critical steps. This runs the action silently; if the command fails, it displays the failing command name with full output logs, cleans up the temporary workdir, and exits with error status. As a reminder, the reason this is necessary is that our script convention is to output a series of environment variables to stdout -- we must therefore take pains not to emit anything else to stdout. And, unfortunately, podman and openssl tend to be rather verbose. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Attempt to turn on additional build testsDaniel J Walsh2020-05-22
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* add go-bindings for `hack/podman-registry`Valentin Rothberg2020-05-20
| | | | Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* New tool: hack/podman-registry, manages local registryEd Santiago2020-05-20
| | | | | | | | | | | | | | | | | | | In response to #6207: this is a helper script intended for use in starting and stopping a local container registry. It takes care of port, username, password assignments; generates a self-signed certificate; and starts the container in an isolated podman root/runroot to avoid conflicting with the caller's environment. Intended usage: invoke from shell script, using 'eval' to get results into calling process environment. See help message (-h) for invocation details. This will work for shell scripts but will be difficult if called from Go or C - if that is likely to happen, I'd love to hear suggestions for alternate ways to get the settings back to the caller. Signed-off-by: Ed Santiago <santiago@redhat.com>