summaryrefslogtreecommitdiff
path: root/cmd/podman/images
Commit message (Collapse)AuthorAge
* podman save: update --compress validationHoang Thanh VO2022-09-06
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Hoang Thanh VO <111461555+ht-vo@users.noreply.github.com>
* Add support for sigstoreSigned in (podman image trust set)Miloslav Trmač2022-08-29
| | | | | | | | NOTE: This does not edit the use-sigstore-attachments value in registries.d, similarly to how (podman image trust set) didn't set the lookaside paths for simple signing. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* When removing objects specifying --force,podman should exit with 0Daniel J Walsh2022-08-10
| | | | | | | | | | | | This Patch will cause podman COMMAND rm --force bogus not fail This is how Docker works, so Podman should follow this to allow existing scripts to convert from Docker to Podman. Fixes: #14612 Oprignal version of this patch came from wufan 1991849113@qq.com Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* build: implement --cache-to,--cache-from and --cache-ttlAditya R2022-08-10
| | | | | | | [NO NEW TESTS NEEDED] [NO TESTS NEEDED] Signed-off-by: Aditya R <arajan@redhat.com>
* Add support for creating sigstore signatures, and providing passphrasesMiloslav Trmač2022-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Allow creating sigstore signatures via --sign-by-sigstore-private-key . Like existing --sign-by, it does not work remote (in this case because we would have to copy the private key to the server). - Allow passing a passphrase (which is mandatory for sigstore private keys) via --sign-passphrase-file; if it is not provided, prompt interactively. - Also, use that passphrase for --sign-by as well, allowing non-interactive GPG use. (But --sign-passphrase-file can only be used with _one of_ --sign-by and --sign-by-sigstore-private-key.) Note that unlike the existing code, (podman build) does not yet implement sigstore (I'm not sure why it needs to, it seems not to push images?) because Buildah does not expose the feature yet. Also, (podman image sign) was not extended to support sigstore. The test for this follows existing (podman image sign) tests and doesn't work rootless; that could be improved by exposing a registries.d override option. The test for push is getting large; I didn't want to start yet another registry container, but that would be an alternative. In the future, Ginkgo's Ordered/BeforeAll would allow starting a registry once and using it for two tests. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Use signByFlagName instead of copy&pasting the stringMiloslav Trmač2022-08-02
| | | | Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Podman pull --all-tags shorthand optionJake Correnti2022-07-26
| | | | | | | I added the shorthand option for `podman pull --all-tags`. Like Docker, Podman can now do `podman pull -a`. Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
* cmd/podman: switch to golang native error wrappingSascha Grunert2022-06-30
| | | | | | | We now use the golang error wrapping format specifier `%w` instead of the deprecated github.com/pkg/errors package. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
* podman image scp remote support & podman image scp taggingcdoern2022-06-28
| | | | | | | | | | | | | | | | | | | add support for podman-remote image scp as well as direct access via the API. This entailed a full rework of the layering of image scp functions as well as the usual API plugging and type creation also, implemented podman image scp tagging. which makes the syntax much more readable and allows users t tag the new image they are loading to the local/remote machine: allow users to pass a "new name" for the image they are transferring `podman tag` as implemented creates a new image im `image list` when tagging, so this does the same meaning that when transferring images with tags, podman on the remote machine/user will load two images ex: `podman image scp computer1::alpine computer2::foobar` creates alpine:latest and localhost/foobar on the remote host implementing tags means removal of the flexible syntax. In the currently released podman image scp, the user can either specify `podman image scp source::img dest::` or `podman image scp dest:: source::img`. However, with tags this task becomes really hard to check which is the image (src) and which is the new tag (dst). Removal of that streamlines the arg parsing process Signed-off-by: Charlie Doern <cdoern@redhat.com>
* Update vendor of containers/buildahDaniel J Walsh2022-06-13
| | | | | | | | Changes since 2022-05-31: - add --omit-history option (buildah PR 4028) Signed-off-by: Ed Santiago <santiago@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #14560 from rhatdan/remoteOpenShift Merge Robot2022-06-13
|\ | | | | podman-remote push --remove-signatures support
| * podman-remote push --remove-signatures supportDaniel J Walsh2022-06-10
| | | | | | | | | | | | | | | | | | I don't see a reason why we don't support --remove-signatures from remote push, so adding support. Fixes: https://github.com/containers/podman/issues/14558 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | vendor buildah@mainValentin Rothberg2022-06-10
|/ | | | | | | Note that the bud-logfile-with-split-logfile-by-platform test is skipped on the remote client (see #14544). Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Merge pull request #14460 from cipherboy/align-docker-podman-load-outputOpenShift Merge Robot2022-06-02
|\ | | | | Align docker load and podman load output
| * Align docker load and podman load outputAlexander Scheel2022-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comma-separated podman load output isn't conducive for using the subsequent images. For tarballs with multiple images, the comma separator must be manually identified and a suitable range identified. Docker CLI on the other hand, has one image identifier per line: Loaded image: repo1/name1:latest Loaded image: repo1/name1:tag1 Loaded image: repo2/name2:tag1 (as of Docker version 20.10.16, build aa7e414). Switch `podman load` to this format for consistency and usability. [NO NEW TESTS NEEDED] Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
* | vendor: bump buildah to v1.26.1-0.20220524184833-5500333c2e06Aditya R2022-05-26
| | | | | | | | | | | | Bump buildah to v1.26.1-0.20220524184833-5500333c2e06 Signed-off-by: Aditya R <arajan@redhat.com>
* | build: allow using cache explicitly with --squash-all using --layersAditya R2022-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Buildah already supports using `--layers` with `--squash` after https://github.com/containers/buildah/pull/3674 if user wants to do so hence podman must honor similar configuration in `--squash-all` behaviour if user wants to using cache. PS: We cannot alter behaviour of `podman build --squash` for docker-compat reasons hence this feature can be easily supported by `--squash-all`. Closes: https://github.com/containers/buildah/issues/4011 Signed-off-by: Aditya R <arajan@redhat.com>
* | cmd, build: remove redundant squash processing logicAditya R2022-05-26
| | | | | | | | | | | | | | | | | | | | Same block contains similar lines above this is not needed as this looks redundant. [NO NEW TESTS NEEDED] [NO TESTS NEEDED] Signed-off-by: Aditya R <arajan@redhat.com>
* | Remove unused archive flag from diff commandsJhon Honce2022-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | * Option left in images/diff.go CLI as comment implies it is needed for backwards compatibility. ```release-note NONE ``` [NO NEW TESTS NEEDED] Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Merge pull request #14327 from rhatdan/commonOpenShift Merge Robot2022-05-24
|\ \ | | | | | | Use containers/common/pkg/util.StringToSlice
| * | Use containers/common/pkg/util.StringToSliceDaniel J Walsh2022-05-23
| |/ | | | | | | | | | | [NO NEW TESTS NEEDED] Just code cleanup for better reuse Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | podman image mount: print pretty tableValentin Rothberg2022-05-24
| | | | | | | | | | | | | | | | | | Make sure that `podman image mount` prints a pretty table unless there is only argument passed and without a custom format. Fixing a TODO item brought me to the specific code location and revealed the fart in the logic. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | autocomplete `podman search --filter`Valentin Rothberg2022-05-24
|/ | | | Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* shell completion: podman save --format use all valid valuesPaul Holzinger2022-05-19
| | | | | | | docker-archive was missing from the completions. To prevent duplication use the same format list as podman save. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* shell completion: update podman inspect --type optionsPaul Holzinger2022-05-19
| | | | | | | | | Add all option that are supported by the podman inspect --type flag to the completions. Also use the same constants instead of duplicating the strings. In order to do this I had to move the definitions into the common package to prevent an import cycle. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* build: disable --output for podman-remote clientsAditya R2022-05-05
| | | | | | | | | Disable `build --output` for remote clients and update docs. [NO NEW TESTS NEEDED] [NO TESTS NEEDED] Signed-off-by: Aditya R <arajan@redhat.com>
* Vendor in containers/buildah@v1.26.1Daniel J Walsh2022-05-05
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* image search --format: add completion for go templatePaul Holzinger2022-04-28
| | | | | | | podman image search accepts a go template, we can use the same shell completion logic which is used everywhere else in the code. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* shell completion --format: use structs by referencePaul Holzinger2022-04-28
| | | | | | | | | | | | For the AutocompleteFormat function we expect the correct template struct which is used in the golang template. The function can handle both struct and pointer to a struct. Using the reference is more efficient since it doe snot have to copy the whole struct. Also change some structs to use he actual type from the template instead of some nested one to make sure it has to correct fields. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* image --format: fix add completion for go templatePaul Holzinger2022-04-28
| | | | | | | | It used the wrong struct so not all fields were listed in the completion. Fixes podman images --format and podman image history --format Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* podman search: truncate by defaultValentin Rothberg2022-04-28
| | | | | | | | | | Truncate by default to avoid long descriptions from rendering the output unreadable. [NO NEW TESTS NEEDED] Fixes: #14044 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Add CreatedSince & CreatedAt format fields to podman image historyDaniel J Walsh2022-04-27
| | | | | | Fixes: https://github.com/containers/podman/issues/14012 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* enable gocritic linterPaul Holzinger2022-04-26
| | | | | | | | | | | | | | | | | | | | | | The linter ensures a common code style. - use switch/case instead of else if - use if instead of switch/case for single case statement - add space between comment and text - detect the use of defer with os.Exit() - use short form var += "..." instead of var = var + "..." - detect problems with append() ``` newSlice := append(orgSlice, val) ``` This could lead to nasty bugs because the orgSlice will be changed in place if it has enough capacity too hold the new elements. Thus we newSlice might not be a copy. Of course most of the changes are just cosmetic and do not cause any logic errors but I think it is a good idea to enforce a common style. This should help maintainability. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* replace golint with revive linterPaul Holzinger2022-04-22
| | | | | | | | | | | | golint, scopelint and interfacer are deprecated. golint is replaced by revive. This linter is better because it will also check for our error style: `error strings should not be capitalized or end with punctuation or a newline` scopelint is replaced by exportloopref (already endabled) interfacer has no replacement but I do not think this linter is important. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* move golang.org/x/crypto/ssh/terminal to golang.org/x/termPaul Holzinger2022-04-22
| | | | | | | | golang.org/x/crypto/ssh/terminal is deprecated. The package was moved to golang.org/x/term. golang.org/x/crypto/ssh/terminal was already just calling golang.org/x/term itslef so there are no functional changes. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* Revert "images --size"Valentin Rothberg2022-04-14
| | | | | | | | | | | | This reverts commit e133a06d2f4a3e94bfbd60b647046f2f515c9c24. @nalind found a proper fix in c/storage [1] to address the performance issue. So we really don't need the flag anymore. Note the flag has never made it into any release. [1] https://github.com/containers/storage/commit/d76b3606fc9ca975bf436379f91105f0fac1555f Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* images --sizeValentin Rothberg2022-04-08
| | | | | | | | | | Add a --size option to podman images to allow for disabling computing the size of listed images. If listing images is critical to performance, user may chose to turn off size computation to speed things up. Context: #13755 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Remove error stutterDaniel J Walsh2022-03-25
| | | | | | | | | | | | | | | | | When podman gets an error it prints out "Error: " before printing the error string. If the error message starts with error, we end up with Error: error ... This PR Removes all of these stutters. logrus.Error() also prints out that this is an error, so no need for the error stutter. [NO NEW TESTS NEEDED] Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #13588 from flouthoc/import-os-archOpenShift Merge Robot2022-03-23
|\ | | | | import: allow users to set `--os`, `--arch` and `--variant` of image imports
| * import: allow users to set os, arch and variant of importsAditya R2022-03-23
| | | | | | | | | | | | | | | | | | | | Allows users to set `--os` , `--arch` and `--variant` of the image created from the custom import. Following is useful when user is already aware of the values which are correct for their generated rootfs Signed-off-by: Aditya R <arajan@redhat.com>
* | fix a number of errcheck issuesValentin Rothberg2022-03-22
| | | | | | | | | | | | Numerous issues remain, especially in tests/e2e. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | linter: enable nilerrValentin Rothberg2022-03-22
| | | | | | | | | | | | | | A number of cases looked suspicious, so I marked them with `FIXME`s to leave some breadcrumbs. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | linter: enable wastedassignValentin Rothberg2022-03-22
|/ | | | Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* podman rmi --ignoreValentin Rothberg2022-03-19
| | | | | | | | | | | Add an `--ignore` flag to `podman image rm` to instruct ignoring image if a specified image does not exist and to not throw an error. Other commands (e.g., `podman container rm`) already support this flag. Such an `--ignore` flag can come in handy in clean-up scripcts such as the teardown phases in the Podman tests. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* go fmt: use go 1.18 conditional-build syntaxValentin Rothberg2022-03-18
| | | | Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Cleanup display of trust with transportsDaniel J Walsh2022-02-22
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #13047 from cdoern/scpSyntaxOpenShift Merge Robot2022-02-03
|\ | | | | podman image scp syntax correction
| * podman image scp syntax correctioncdoern2022-01-27
| | | | | | | | | | | | | | | | | | [NO NEW TESTS NEEDED] image scp was reading the localhost syntax too loosely causing some errors with domains or hosts containing the word localhost. Fixed that and added a few lines to make sure the pure localhost connections do not touch sshd resolves #13021 Signed-off-by: cdoern <cdoern@redhat.com>
* | Merge pull request #13029 from TomSweeneyRedHat/dev/tsweeney/mergepull2OpenShift Merge Robot2022-01-27
|\ \ | | | | | | Bump Buildah to v1.24.0
| * | Bump Buildah to v1.24.0tomsweeneyredhat2022-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bumps Buildah to v1.24.0 and adopts the new values for pull: true, false, never, and always. The pull-never and pull-always options for the build command are still usable, but they have been removed from the man page documentation with this change. Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>