Commit Graph

84 Commits

Author SHA1 Message Date
Daniel J Walsh 0f802d0065 Add image_default_format
Currently when pulling/pushing images we default to the format
of the source image.  When Building images we default to OCI.

Customers have asked us to allow them to force a specific image
type when pushing to a registry.

We already have a flag to building images.

This PR adds image_default_format to define the format to be used
by all tools create/building/pulling and pusing images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-01 06:38:50 -05:00
Daniel J Walsh 952d2c9991 Add image_parallel_copies engine config
This will allow users to configure the amount of parallel copies that
the container engines are allowed to do. This allows users to configure
their systems to match their available network settings.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-21 14:59:34 -05:00
Giuseppe Scrivano 52dd8b2d67 config: fix runtime_supports_nocgroup key name
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-13 15:11:54 +01:00
Daniel J Walsh 2694f2c7dc Add new function to setup default environment
Need to be able to getdefault container environment
based on use provided functions on httpProxy and use
the environment from the host.

This way users can modify the environment from podman

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-07 15:48:11 -05:00
Daniel J Walsh 44e14b12b9 Find ociruntime instead of hard coding default
Users could have any one of the OCI runtimes installed,
code will search for default.  This way they do not need
to modify defaults if they have "crun" installed.

Search order will be crun, runc, kata

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-15 05:43:45 -05:00
OpenShift Merge Robot 16098c3cca Merge pull request #371 from mheon/add_volume_plugins
Add a volume plugins field to containers.conf
2020-12-04 16:29:28 -05:00
Matthew Heon 33a960773b Add a volume plugins field to containers.conf
We decided that making users explicitly list plugins they wanted
to use was not a bad thing, and greatly simplifies our
implementation. As such, we need a place to do that, and
`containers.conf` is the logical location.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-12-04 13:48:24 -05:00
Daniel J Walsh f58e310727 Remove libpod.conf
We no longer support libpod.conf, remove any code that deals with it.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-04 08:11:31 -05:00
Daniel J Walsh d568d40354 Add ability to set system wide options for slirp4netns
Also fixup some formatting issues in man pages.

Fix generation of multiple man pages.

Partial fix for: https://github.com/containers/podman/issues/7888

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-25 13:42:53 -05:00
Daniel J Walsh 69ee79b12c Add support for enabling/disabling kernel keyring in engines
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-20 13:39:24 -05:00
Daniel J Walsh 86a01f6857 Enabled the remote flag to be accessible by users
This flag would allow users to run the podman command
in podman-remote mode by default. If you are primarily using
podman to access a remote server, you might want to enable this
flag and not have to install podman-remote as well as podman command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-30 05:11:43 -04:00
Daniel J Walsh d2c4ee7ce3 Allow users to specify the default format for image builds
Some users want to stick to "docker" format escecially since some older
container registries don't properly support OCI images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-21 16:13:48 -04:00
Daniel J Walsh 00631f7fa2 Add support for CONTAINER_CONNECTION environment variable
Users on the MAC have pointed out that they could have multiple connections
to different servers, and they asked to be able to specify the connection
name via environmnet variable rather then to always have to specify the
connection on the command line if they did not want to use the default
setting.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-16 07:06:04 -04:00
Daniel J Walsh fd6f9bf750 Fix problems found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-12 05:50:05 -04:00
Qi Wang f1c4d645f6 ValidatePullPolicy case-insensitive
Set pullpolicy case-insensitive for fixing https://github.com/containers/podman/issues/7246. And replce the duplicate code in podman with c/common code.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-10 17:05:35 -04:00
Sascha Grunert 89b399d4cf Fix all gocritic lints
This enables the missing gocritic checks and fixes all of the lints.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-25 20:58:15 +02:00
Sascha Grunert b494081304 Change fmt.Errorf calls to be replaced by errors package
We now use wrapped errors instead of indirectly wrapping them by
`fmt.Errorf`. The error messages have also been cleaned-up to reduce
duplicate words like `failed`.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-25 11:37:12 +02:00
Brent Baude 054d133710 getCustomConfigFile for windows and darwin
podman remote clients that run on windows and darwin cannot use the isRootless to determine the configuration file locations.  here we do by OS and also honor the environment variable.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-22 09:11:12 -04:00
Valentin Rothberg f217b00ded multi_image_archive: add option for `podman save`
Add an option to control the default behavior of `podman save` or other
container engines.  If set to "true", the engine will create a
multi-image (docker) archive.  By default, Podman will interpret
additional arguments as tags that'll be stored in the archive's
manifest.  Docker interprets additional arguments as images to allow for
creating multi-image archives.  This option allows users to chose how
they wish the default behavior to look like, so we don't break
compatibility with existing Podman workloads while being compatible
with Docker.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-08-17 14:44:43 +02:00
Valentin Rothberg 988b089a30 Merge pull request #221 from giuseppe/permit-rootless-cni
rootless: permit custom configuration for cni
2020-07-21 11:46:04 +02:00
Daniel J Walsh b6bb9b862f Remove extra lock in Reload function
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-19 07:13:12 -04:00
Tom Sweeney b0dff4761d Merge pull request #223 from ashley-cui/umask
Add support for Umask
2020-07-15 19:43:44 -04:00
Daniel J Walsh 3e3982860a Merge pull request #224 from QiWang19/default-cfg
Fix config reload race
2020-07-15 18:07:46 -04:00
Qi Wang bf0929d101 Fix config reload race
Fix the config reload race following the comments #219.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-07-15 18:06:09 -04:00
Jhon Honce 4f496fde52 Add support for multiple service destinations
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-07-15 14:02:00 -07:00
Ashley Cui 93a6847b2d Add support for Umask
Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-15 13:59:29 -04:00
Qi Wang 4c9e0ba4cd Add config reload
Add Reload() to reload configurations from containers.conf files.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-07-14 15:08:18 -04:00
Giuseppe Scrivano d6300be2bb rootless: permit custom configuration for cni
I am experimenting with supporting CNI in rootless Podman.  There is
no harm in preparing common to support such case and allow a custom
per-user configuration.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-14 15:43:59 +02:00
Daniel J Walsh 9c7d0b5a00 Merge pull request #204 from nalind/discard
readConfig(): don't return a pointer that's often ignored
2020-06-30 20:33:00 -04:00
Daniel J Walsh 560bd489ae Merge pull request #200 from ashley-cui/master
Add support for timezone
2020-06-30 17:07:39 -04:00
Ashley Cui bf1b8b15b6 Add support for timezone
Signed-off-by: Ashley Cui <acui@redhat.com>
2020-06-30 15:07:49 -04:00
Nalin Dahyabhai d045e7f373 readConfig(): don't return a pointer
Remove the often-unused result value from readConfig().

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-06-30 15:02:39 -04:00
Qi Wang 3d8b92bdb2 Specify container engine in comments of engine env
Specify that the container engines are Podman, Buildah

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-30 11:59:46 -04:00
Qi Wang 82a0ff9d5c Add container_engine_env for engine to use
Add container_env_var for setting envariables for engin to use.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-29 16:50:14 -04:00
Daniel J Walsh dd0b47bedf Fix testing to not race on containers.conf
Looks like the Write test has to run last.  Not sure why this is
crashing but this fixes the issue.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-25 06:04:39 -04:00
Daniel J Walsh 467bf8407a Remove race condition on sync.Once
We had a race condition where the sync.Once was called, and initializing
the default Config, but another thread hit it simultaniously and got the
nil value.
This patch will always return a correct value.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-24 08:52:44 -04:00
Daniel J Walsh b804d2aa5f Add ability to read and write a default config file
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-16 10:31:01 -04:00
Jhon Honce a6e9a791a4 V2 Store identity associated with remote URL
* as workaround user can use --identity option when given commands
  requiring a SSH key

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-08 10:15:06 -07:00
Daniel J Walsh a3a0a08b50 Add support for Remote flags in containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-28 15:47:01 -04:00
Daniel J Walsh 7b97b08724 Do not validate paths on remote platforms
Modify validate functions to work on a remote clients.
Any of the path checks will not work on remote machines or make
sense on remote clients. Therefore they should not be checked.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-28 13:29:37 -04:00
Daniel J Walsh ef4c52742f Add full path for error messages on containers.conf
Also add new function to allow container engines to tell users
where to edit containers.conf file.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-26 15:36:10 -04:00
Daniel J Walsh e371ed9f34 Revert removal of Set flags
Even though these are not read from the config file, they are
still required as fields to pass data in libpod.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-16 06:38:31 -04:00
Daniel J Walsh eab34f5581 Ignore empty strings from libpod.conf
If the user has a libpod.conf file with an option of "", then
we will ignore it and use the value from containers.conf.

Also the Set variables are only to be set, if a user specified an
override command, not if they were set in the libpod.conf file.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-15 17:05:28 -04:00
Valentin Rothberg 0ef2bfea2e pkg/config: set correct path in XDG_CONFIG_HOME
The rootless config path was wrong when running with XDG_CONFIG_HOME
set.

Reported-in: github.com/containers/libpod/issues/6163
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-11 13:42:43 +02:00
Daniel J Walsh cd83b65ee2 Do not set StaticDirSet, TmpDirSet,VolumePathSet
These indicate that the user has modified the settings.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-07 16:09:27 -04:00
Daniel J Walsh f681e24f01 Fix config.Capabilities function call
We need to normalize the capadd and capdrop functions, and
we need to return errors if the caller gives us bad input.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-30 17:41:07 -04:00
Daniel J Walsh c58a215838 Add support for cgroups configuration
We need to be able to disable cgroups when running container engines inside of containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-13 13:56:16 -04:00
Daniel J Walsh c719975a94 Add RuntimeSupportsKVM to config.Engine
We need to identify the list of containers that support KVM separation, these
containers can run with a different SELinux label, and we might be able to
make different decisions in the container engines about how to launch these
containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-07 10:11:59 -04:00
Daniel J Walsh ed25ff4eb6 Add more utils for returning defaults
Move pkg/sysinfo and pkg/apparmor out of libpod into containers/common.

This will allow other packages to use these libraries without requiring all of libpod.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-01 08:39:44 -04:00
Daniel J Walsh a21cf229ee Move pkg/unshare to containers/storage/pkg/unshare
This removes a circular dependancy

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-31 08:42:12 -04:00