Commit graph

3601 commits

Author SHA1 Message Date
Leonardo Rossetti cd3492304e
adding -dryrun flag
Signed-off-by: Leonardo Rossetti <lrossett@redhat.com>
2023-01-03 09:19:48 -03:00
Ygal Blum 68fbebfacc Kube Play: use passthrough as the default log-driver if service-container is set
Reasoning
---------
When the log-driver is passthrough, the journal socket is passed to the containers as-is which has two advantages:
1. journald can see who the actual sender of the log event is,
    rather than thinking everything comes from the conmon process
2. conmon will not have to copy all the log data

Code Changes
------------
If log-driver was not set by the user and service-container is set use
passthrough as the default log-driver

Update the system tests
- explicitly set logdriver in sdnotify and play tests
- podman-kube template test:  Verify the default log driver for service-container

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-03 10:34:24 +02:00
Jake Correnti 479052afa6 Fixed podman update --pids-limit
Added the functionality for a user to update the PIDs limit for a
container.

Fixes: #16543

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2022-12-31 18:42:47 -05:00
Daniel J Walsh 0c94f61852
Allow '/' to prefix container names to match Docker
Fixes: https://github.com/containers/podman/issues/16663

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-26 07:37:43 -05:00
Brent Baude 0c68058805 Remove references to qcow2
Issue #16928 rightly points out that qcow2 images are not used on all
podman architectures.

Fixes: #16928

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-12-25 10:49:47 -06:00
OpenShift Merge Robot 4a57cfb926
Merge pull request #16545 from rhatdan/read-only
Add containers.conf read-only flag support
2022-12-25 07:56:23 -05:00
OpenShift Merge Robot 9fbf91801d
Merge pull request #16904 from rhatdan/system
Output Size and Reclaimable in human form for json output
2022-12-22 13:49:17 -05:00
Daniel J Walsh 338b283935
Add containers.conf read-only flag support
If you are running temporary containers within podman play kube
we should really be running these in read-only mode. For automotive
they plan on running all of their containers in read-only temporal
mode. Adding this option guarantees that the container image is not
being modified during the running of the container.

The containers can only write to tmpfs mounted directories.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-22 11:57:28 -05:00
OpenShift Merge Robot 5211446516
Merge pull request #16901 from Luap99/service-close-fd
podman service: close duplicated /dev/null fd
2022-12-22 03:51:03 -05:00
Ed Santiago 97f9d625a9
New system tests for conflicting options
...make sure podman rejects being called with incompatible options

Replaces: https://github.com/containers/podman/pull/16813

Which is stuck in CI and Ed is on break.

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-21 06:23:29 -05:00
Daniel J Walsh 24b1e81c5d
Output Size and Reclaimable in human form for json output
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-20 17:11:21 -05:00
Paul Holzinger 4724fa3075
podman service: close duplicated /dev/null fd
Since we open /dev/null to set it as STDIN we can close it after the
dup2() call. Using defer is not good enough since this function will
never exit since the http server will block. This is not a problem but
it reduces the open fds from the service by one.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-12-20 17:17:37 +01:00
OpenShift Merge Robot 5f4d7b575d
Merge pull request #16888 from Luap99/export-fd
export: use io.Writer instead of file
2022-12-20 10:47:19 -05:00
Paul Holzinger 3ac5d10098
export: use io.Writer instead of file
This allows use to use STDOUT directly without having to call open
again, also this makes the export API endpoint much more performant
since it no longer needs to copy to a temp file.
I noticed that there was no export API test so I added one.

And lastly opening /dev/stdout will not work on windows.

Fixes #16870

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-12-20 14:38:41 +01:00
Aditya R 987c8e3a78
vendor: bump to buildah ca578b290144 and use new cache API
Bump to buildah ca578b290144 and use new `cacheTo` and `cacheFrom` API.

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-12-20 17:13:59 +05:30
OpenShift Merge Robot fb967aabc3
Merge pull request #16878 from rhatdan/docs
Unify --noheading and -n to be consistent on all commands
2022-12-19 15:08:02 -05:00
OpenShift Merge Robot b0acb59ccb
Merge pull request #16688 from ygalblum/quadlet_network_file
Quadlet: add network support
2022-12-19 14:16:53 -05:00
Daniel J Walsh 9187df5b28
Unify --noheading and -n to be consistent on all commands
Helps with https://github.com/containers/podman/issues/16536

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-19 13:18:43 -05:00
Ygal Blum d974a79e27 Quadlet: add network support
Support .network file to create a systemd service that runs podman network create
Support networks with .network suffix in Container and Kube to link with Quadlet created networks
Add E2E Tests
Add man doc

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-12-18 11:25:20 +02:00
Alexander Larsson 20b10574d7 quadlet: Add --user option
Normally quadlet picks up whether to behave like a user or system
instance based on the binary name, but for the tests we want the
ability to pass `--user` to modify this using a single binary.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-12-16 14:55:40 +01:00
Valentin Rothberg f4d0496b54 wait: add --ignore option
In the recent past, I met the frequent need to wait for a container to
exist that, at the same time, may get removed (e.g., system tests in [1]).

Add an `--ignore` option to podman-wait which will ignore errors when a
specified container is missing and mark its exit code as -1.  Also
remove ID fields from the WaitReport.  It is actually not used by
callers and removing it makes the code simpler and faster.

Once merged, we can go over the tests and simplify them.

[1] github.com/containers/podman/pull/16852

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-12-16 10:24:29 +01:00
OpenShift Merge Robot 1cc22631f6
Merge pull request #16773 from ygalblum/network_ignore
Network Create: Add --ignore flag to support idempotent script
2022-12-15 14:27:25 -05:00
OpenShift Merge Robot 236321c0ad
Merge pull request #16851 from vrothberg/lint
bump golangci-lint to v1.50.1
2022-12-15 11:59:09 -05:00
Valentin Rothberg dcbf7b4481 bump golangci-lint to v1.50.1
Also fix a number of duplicate words.  Yet disable the new `dupword`
linter as it displays too many false positives.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-12-15 13:39:56 +01:00
Valentin Rothberg 46b7d8d1e0 create/pull --help: list pull policies
[NO NEW TESTS NEEDED]

Fixes: #16845
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-12-15 10:24:44 +01:00
Ygal Blum bddd3f5b5f Network Create: Add --ignore flag to support idempotent script
Add --ignore flag to the command line
Add a new parameter to the NetworkCreate interface in pkg/domain for CreateOptions
Add a new API Network CreateWithOptions in pkg/bindings
Remote API - Add a query parameter to set the ignore flag
Kube - use the IgnoreIfExists flag when creating the default network instead of handling the failure
Add e2e tests
Update man page for podman-network-create

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-12-15 10:58:54 +02:00
OpenShift Merge Robot 415a702bc3
Merge pull request #16799 from rhatdan/build
Add podman buildx version support
2022-12-13 20:24:03 -05:00
OpenShift Merge Robot d8e23dfbed
Merge pull request #16549 from sstosh/remote-manifest-annotation
Add support for podman-remote manifest annotate
2022-12-12 09:29:06 -05:00
Daniel J Walsh 43e307b84f
Add podman buildx version support
Fixes: https://github.com/containers/podman/issues/16793

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-09 12:03:22 -05:00
OpenShift Merge Robot 859f40a2eb
Merge pull request #16776 from Luap99/http-proxy
remote: allow --http-proxy for remote clients
2022-12-09 05:23:38 -05:00
OpenShift Merge Robot 15fca66e78
Merge pull request #16777 from Luap99/build-remote-volume
podman-remote build add --volume support
2022-12-09 04:32:57 -05:00
Paul Holzinger 9f6cf50d52
podman-remote build add --volume support
Just like podman-remote run users should still be able to set volumes,
of course the source must be on the server machine but this is already
the case for podman machine for example.

Fixes #16694

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-12-08 17:10:46 +01:00
Paul Holzinger 2dde30b93a
remote: allow --http-proxy for remote clients
The remote client should be allowed to specify if the container should
be run with the proxy env vars. It will still use the proxy vars from
the server process and not the client. This makes podman-remote more
consistent with the local version and easier to use in environments
where a proxy is required.

Fixes #16520

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-12-08 17:08:37 +01:00
Urvashi Mohnani 2f29639bd3 Cleanup kube play workloads if error happens
If an error happening while playing a kube yaml,
clean up any pods, containers, and volumes that might
have been created before the error was hit.
This improves the user experience for when they go to
re-run the same yaml with their fixes and podman doesn't
complain about any existing workloads from the previously
failed run.

Suppress the clean up output when clean up happens after an
error as the user doesn't need to see or know about that.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-12-08 10:30:44 -05:00
OpenShift Merge Robot 883ff665b2
Merge pull request #16748 from ygalblum/quadlet_kube_userns
Quadlet Kube: Add support for userns flag
2022-12-06 18:03:41 -05:00
OpenShift Merge Robot 7cdf37624e
Merge pull request #16747 from Luap99/ipvlan-parent
network create: support "-o parent=XXX" for ipvlan
2022-12-06 10:54:11 -05:00
OpenShift Merge Robot 4a8d953425
Merge pull request #16371 from alexlarsson/transient-store
Support transient store mode
2022-12-06 09:39:19 -05:00
Ygal Blum 1ea00ebda1 Quadlet Kube: Add support for userns flag
Move the handling of userns keys from ConvertContainer to a separate method
Adjust the method according to the different supported values
Use the new method in both ConvertContainer and ConvertKube
Pass isUser to ConvertKube as well
Add tests

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-12-05 21:26:23 +02:00
Alexander Larsson 93d2ec148c Add podman system prune --external
This just calls GC on the local storage, which will remove any leftover
directories from previous containers that are not in the podman db anymore.
This is useful primarily for transient store mode, but can also help in
the case of an unclean shutdown.

Also adds some e2e test to ensure prune --external works.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-12-05 18:09:21 +01:00
Alexander Larsson 25d9af8f42 runtime: Handle the transient store options
This handles the transient store options from the container/storage
configuration in the runtime/engine.

Changes are:
 * Print transient store status in `podman info`
 * Print transient store status in runtime debug output
 * Add --transient-store argument to override config option
 * Propagate config state to conmon cleanup args so the callback podman
   gets the same config.

Note: This doesn't really change any behaviour yet (other than the changes
in containers/storage).

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-12-05 18:09:21 +01:00
Paul Holzinger c9961e18c0
network create: support "-o parent=XXX" for ipvlan
Just like macvlan the ipvlan driver accepts a specific parent interface.

Fixes #16621

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-12-05 18:02:46 +01:00
Daniel J Walsh 39b6ccb384
Add completion for --init-ctr
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-03 08:20:49 -05:00
OpenShift Merge Robot 9b6467a9d2
Merge pull request #16648 from ashley-cui/machos
Introduce podman machine os commands
2022-12-03 07:23:10 -05:00
OpenShift Merge Robot c00d8a27d9
Merge pull request #13909 from mheon/startup_probe
Add support for startup healthchecks
2022-11-30 15:23:15 -05:00
Daniel J Walsh f17479c711
Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-28 15:13:43 -05:00
Matthew Heon d16129330d Add support for startup healthchecks
Startup healthchecks are similar to K8S startup probes, in that
they are a separate check from the regular healthcheck that runs
before it. If the startup healthcheck fails repeatedly, the
associated container is restarted.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-11-28 13:30:29 -05:00
Ashley Cui 96c208efb5 Introduce podman machine os commands
Introduce machine os and machine os apply. Note that these are both stubs at the current moment, and do not introduce functionality. In order to build them, you must use the `experimental` build tag, or use `make podman-remote-experimental`

[NO NEW TESTS NEEDED]
as there is no actual functionality and this is a WIP.

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-11-28 11:50:01 -05:00
OpenShift Merge Robot c1db4f85ae
Merge pull request #16329 from gupttaru/encryption-decryption-feature
Add encryption decryption feature
2022-11-28 06:33:59 -05:00
gupttaru 3bb9ed4f09 Adding encryption decryption feature
Signed-off-by: Tarun1 Gupta <gupttaru@deshaw.com>
2022-11-24 04:53:59 -05:00
Toshiki Sonoda a4ba5f449f Add support for podman-remote manifest annotate
Now that podman manifest annotate is supported
in the remote environment.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-11-24 14:11:08 +09:00
Ygal Blum 3084ed4686 Quadlet: Add support for .kube files
Get the path to the yaml file and call podman kube play
Add tests

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-11-22 16:58:01 +02:00
Paul Holzinger e7eed5aa90
shell completion: fix hard coded network drivers
Depending on the backend (CNI, netavark) we support different drivers,
the auto completion should only suggest the ones that are available.

This list is podman info so we can get the correct list for local and
remote.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-11-21 15:33:43 +01:00
OpenShift Merge Robot cea9340242
Merge pull request #16299 from alexlarsson/quadlet-shortname-warning
quadlet: Warn in generator if using short names
2022-11-18 20:01:39 +00:00
OpenShift Merge Robot 54b1fd35bd
Merge pull request #16518 from ashley-cui/noout
Fix podman --noout to suppress all output
2022-11-15 21:57:33 +00:00
OpenShift Merge Robot 7cd3baeb13
Merge pull request #16186 from ashley-cui/shh
Add --quiet and --no-info flags to podman machine start
2022-11-15 21:52:25 +00:00
Ashley Cui 7c1ad8a582 Fix podman --noout to suppress all output
Podman --noout was not suppressing output from commands that do not
create the podman engine. Now, podman --noout properly suppresses output
from every command.

Fixes: https://github.com/containers/podman/issues/16201

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-11-15 08:16:46 -05:00
OpenShift Merge Robot 94e34cc795
Merge pull request #16498 from vrothberg/fix-16421
podman cp: fix copying with "." suffix
2022-11-14 13:46:44 +00:00
OpenShift Merge Robot e656cf43fe
Merge pull request #16328 from cdoern/config
fix connection usage with containers.conf
2022-11-14 12:46:03 +00:00
Valentin Rothberg 3371c9d25e podman cp: fix copying with "." suffix
Fix a bug for special-casing "." where Podman has mistakenly been
looking for a "." suffix instead of interpreting it as a path.

Add regression tests for the host-to-container, container-to-host and
container-to-container use cases.  Have separate tests for each to
verify that previous Podman versions fail each case.

Fixes: #16421
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-14 09:38:02 +01:00
OpenShift Merge Robot 25c67d6b9b
Merge pull request #16462 from rhatdan/manifest
Add hidden podman manifest inspect -v option
2022-11-12 10:51:53 +00:00
Charlie Doern 69d737ef15 fix connection usage with containers.conf
--connection was failing due to the servicedestinations array being empty on runtime.
Fix by making sure the cached config is used

resolves #16282

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-11-11 16:15:02 -05:00
Ashley Cui dd98e3cc64 Add --quiet and --no-info flags to podman machine start
Add quiet and no-info flags to podman machine start.
No-info suppresses helpful informational tips
Quiet suppresses machine start progress output, as well as informational
tips.

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-11-11 16:14:20 -05:00
Daniel J Walsh 00b2bc9b65
Add hidden podman manifest inspect -v option
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-11 15:22:31 -05:00
Daniel J Walsh 836ca6c008
Add podman volume create -d short option for driver
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-11 14:43:07 -05:00
Daniel J Walsh bc77c034f8
Add podman system events alias to podman events
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-11 12:57:49 -05:00
Chris Evich 653ac775c7
Merge pull request #16466 from rhatdan/manifest1
Allow podman manifest push --purge|-p as alias for --rm
2022-11-11 10:50:06 -05:00
OpenShift Merge Robot 6555e69354
Merge pull request #16446 from Luap99/format-json
fix --format {{json .}} output to match docker
2022-11-11 15:48:58 +00:00
OpenShift Merge Robot aaa88f4554
Merge pull request #16141 from sbrivio-rh/pasta
Add pasta networking mode
2022-11-10 17:44:38 +00:00
Daniel J Walsh d9aceadeaa
Allow podman manigest push --purge|-p as alias for --rm
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-09 16:17:38 -05:00
Paul Holzinger 3e08f85353
fix --format {{json .}} output to match docker
`--format json` should not be the same as `--format {{json .}}`, the
later should actually run through the go template and thus create one
json object per entry instead of an json array.

Includes a vendor of c/common@main since it requires a fix from there as
well.

This matches docker compat.
Fixes #16436

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-11-09 17:59:05 +01:00
Ygal Blum 1c8196a9ac kube play: update the handling of PersistentVolumeClaim
Up - do not fail if volume already exists, use the existing one
Down - allow the user to remove the volume by passing --force
Add tests
Update the documentation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-11-08 11:08:50 +02:00
Stefano Brivio aa47e05ae4 libpod: Add pasta networking mode
Conceptually equivalent to networking by means of slirp4netns(1),
with a few practical differences:

- pasta(1) forks to background once networking is configured in the
  namespace and quits on its own once the namespace is deleted:
  file descriptor synchronisation and PID tracking are not needed

- port forwarding is configured via command line options at start-up,
  instead of an API socket: this is taken care of right away as we're
  about to start pasta

- there's no need for further selection of port forwarding modes:
  pasta behaves similarly to containers-rootlessport for local binds
  (splice() instead of read()/write() pairs, without L2-L4
  translation), and keeps the original source address for non-local
  connections like slirp4netns does

- IPv6 is not an experimental feature, and enabled by default. IPv6
  port forwarding is supported

- by default, addresses and routes are copied from the host, that is,
  container users will see the same IP address and routes as if they
  were in the init namespace context. The interface name is also
  sourced from the host upstream interface with the first default
  route in the routing table. This is also configurable as documented

- sandboxing and seccomp(2) policies cannot be disabled

- only rootless mode is supported.

See https://passt.top for more details about pasta.

Also add a link to the maintained build of pasta(1) manual as valid
in the man page cross-reference checks: that's where the man page
for the latest build actually is -- it's not on Github and it doesn't
match any existing pattern, so add it explicitly.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-11-08 00:16:35 +01:00
OpenShift Merge Robot 013bd81417
Merge pull request #16394 from vrothberg/fix-16387
remove container/pod id file along with container/pod
2022-11-04 05:22:57 -04:00
Valentin Rothberg 3fee351c35 remove container/pod id file along with container/pod
Remove the container/pod ID file along with the container/pod.  It's
primarily used in the context of systemd and are not useful nor needed
once a container/pod has ceased to exist.

Fixes: #16387
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-03 17:07:09 +01:00
Daniel J Walsh 274d0f4956
Add --insecure,--tls-verify,--verbose flags to podman manifest inspect
--insecure and --verbose flags for docker compatibility

--tls-verify for syntax compatibility and allow users to inspect
manifests at remote Container Registiries without requiring tls.

Helps fix: https://github.com/containers/podman/issues/14917

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-03 08:00:15 -04:00
Alexander Larsson 7ec743fe74 quadlet: Warn in generator if using short names
These are both slow (trigger loading alias files) and risky (its not
clear which image you mean).

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-11-02 11:55:08 +01:00
Urvashi Mohnani f6c74324bc Add podman kube apply command
Add the abilitiy to deploy the generated kube yaml to a
kubernetes cluster with the podman kube apply command.
Add support to directly apply containers, pods, or volumes
by passing in their names or ids to the command.
Use the kubernetes API endpoints and http requests to connect
to the cluster and deploy the various kubernetes object kinds.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-11-01 15:30:17 -04:00
Daniel J Walsh 71f0c9f33a
Eval symlinks on XDG_RUNTIME_DIR
Partial Fix for https://github.com/containers/podman/issues/14606

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-10-28 14:32:39 -04:00
Debarshi Ray 320ce8c9f2 Consolidate the dependencies for the IsTerminal() API
The rest of the code has been using golang.org/x/* for the IsTerminal()
API for a long time, not github.com/mattn/go-isatty.  It seems better to
stick to packages from the golang.org domain, whenever possible, and one
less dependency is always a good thing.

The modules were not cleaned up with 'make vendor' because 'go mod tidy'
was running into:

go: error loading go 1.16 module graph:
  github.com/containers/image/v5@v5.23.1-0.20221015133641-1921a1993c67
  requires
      github.com/honeycombio/beeline-go@v1.9.0 requires
      github.com/mattn/go-sqlite3@v2.0.3+incompatible: reading
        github.com/mattn/go-sqlite3/go.mod at revision v2.0.3: unknown
        revision v2.0.3

If reproducibility with go 1.16 is not needed:
    go mod tidy -compat=1.17

Since go.mod already requires Go 1.17, the following commands were
manually run:
$ go mod tidy -compat=1.17
$ go mod vendor
$ go mod verify

Further modifications to go.sum were done manually based on the
complaints from postbuild.sh run by the CI.

[NO NEW TESTS NEEDED] as it's not a functional change.

Fixes: 85db895012 ("logging: new mode -l passthrough")

Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2022-10-27 17:45:05 +02:00
OpenShift Merge Robot 47bcd10f61
Merge pull request #16243 from alexlarsson/volume-create-ignore
Add podman volume create --ignore
2022-10-26 15:00:51 -04:00
OpenShift Merge Robot ac8b401c48
Merge pull request #16237 from alexlarsson/quadlet-updates
Various quadlet updates
2022-10-26 04:05:40 -04:00
OpenShift Merge Robot 86f7b99924
Merge pull request #16273 from vrothberg/cidfile
container/pod id file: truncate instead of throwing an error
2022-10-25 07:32:55 -04:00
Alexander Larsson 33eb45c475 quadlet tests: Disable kmsg logging while testing
Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:09:51 +02:00
Alexander Larsson af67f15bc7 quadlet: Embed the correct binary name in the generated comment
The binary name is not the same as in the old quadlet, and can anyway
differ in system and user runs, so use os.Args[0] to get the right name
in the comment.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:08:58 +02:00
Valentin Rothberg 221cfc6872 container/pod id file: truncate instead of throwing an error
Truncate the container and pod ID files instead of throwing an error.
The main motivation is to prevent redundant work when starting systemd
units.  Throwing an error when the file already exists is not preventing
races or file corruptions, so let's leave that to the user which in
almost all cases are generated (and tested) systemd units.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-25 09:37:35 +02:00
OpenShift Merge Robot 63a8f9aeaa
Merge pull request #16234 from jakecorrenti/system-df-verbose-format-usability
Fix `system df` issues with `-f` and `-v`
2022-10-24 11:44:09 -04:00
Alexander Larsson 734c435e01 Add podman volume create --ignore
This ignores the create request if the named volume already exists.
It is very useful when scripting stuff.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-24 17:30:31 +02:00
Valentin Rothberg 4e29ce2baf use cached containers.conf
Use `Default()` instead of re-loading containers.conf.

Also rework how the containers.conf objects are handled for parsing the
CLI.  Previously, we were conflating "loading the defaults" with
"storing values from the CLI" with "libpod may further change fields"
which ultimately led to various bugs and test failues.

To address the issue, separate the defaults from the values from the CLI
and properly name the fields to make the semantics less ambiguous.

[NO NEW TESTS NEEDED] as it's not a functional change.

Fixes: containers/common/issues/1200
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-21 14:03:14 +02:00
Jake Correnti e5032a8dea Fix system df issues with -f and -v
Fixed the issue of `--format` and `--verbose` flags being allowed in
combination with one another.

Implemented functionality for `--format json` or `--format '{{ json }}' `.

Implemented command-completion help for `--format`.

Fixes: #16204

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-10-20 23:12:09 -04:00
OpenShift Merge Robot 5af1c42119
Merge pull request #16211 from vrothberg/fix-16135
system df: fix image-size calculations
2022-10-19 10:46:01 -04:00
Valentin Rothberg b4374f2bd9 move quadlet packages into pkg/systemd
Reduce the number of top-level packages in ./pkg by moving quadlet
packages under ./pkg/systemd.

[NO NEW TESTS NEEDED] - no functional change.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-19 13:38:27 +02:00
Valentin Rothberg 34235b2726 system df: fix image-size calculations
Fix two bugs in `system df`:

1.  The total size was calculated incorrectly as it was creating the sum
    of all image sizes but did not consider that a) the same image may
    be listed more than once (i.e., for each repo-tag pair), and that
    b) images share layers.

    The total size is now calculated directly in `libimage` by taking
    multi-layer use into account.

2.  The reclaimable size was calculated incorrectly.  This number
    indicates which data we can actually remove which means the total
    size minus what containers use (i.e., the "unique" size of the image
    in use by containers).

NOTE: The c/storage version is pinned back to the previous commit as it
      is buggy.  c/common already requires the buggy version, so use a
      `replace` to force/pin.

Fixes: #16135
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-19 11:20:41 +02:00
OpenShift Merge Robot 1a60b30e51
Merge pull request #16035 from alexlarsson/quadlet
Initial quadlet version integrated in golang
2022-10-17 15:13:39 -04:00
Alexander Larsson 62bb59d3b0 Initial quadlet version integrated in golang
Based on the initial port in https://github.com/containers/quadlet/pull/41

This contains the unit tests and the testcases from the C code as well
as modification to the podman spec file based on what the quadlet
spec file looks like, producing a podman-quadlet subpackage.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-17 15:56:03 +02:00
Valentin Rothberg 44bac51fca bump golangci-lint to v1.49.0
Motivated to have a working `make lint` on Fedora 37 (beta).
Most changes come from the new `gofmt` standards.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-17 09:19:41 +02:00
Daniel J Walsh 8356621249
Merge pull request #16125 from containers/dependabot/go_modules/github.com/spf13/cobra-1.6.0
build(deps): bump github.com/spf13/cobra from 1.5.0 to 1.6.0
2022-10-12 16:13:56 -04:00
Paul Holzinger 5da54e1834
docs: add missing options
The new cobra update fixed a bug which caused some options to not be
included in --help when there was already a option with the same name
on a parent command.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-10-12 17:00:27 +02:00
dependabot[bot] b256f5f587
build(deps): bump github.com/spf13/cobra from 1.5.0 to 1.6.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

PH: manually update the completion scripts and fix deprecated function
call.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-10-12 14:54:19 +02:00
Daniel J Walsh f437078d2b
Revert "cmd/podman: add support for checkpoint images"
This reverts commit 9c3d8bb494.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-10-11 07:55:16 -04:00
Boaz Shuster d4f622da7d Return error in podman system service if URI scheme is not unix/tcp
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2022-10-06 14:47:03 +03:00