Commit Graph

125 Commits

Author SHA1 Message Date
Sascha Grunert 4a58c879e2 Change AppArmor profile prefix and fix name-check
The default AppArmor profile is now prefixed with
`container-default-$VERSION`, whereas the version is now part of a new
`version` package.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-06-23 18:11:28 +02: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
dependabot-preview[bot] 461f6406d9 Bump github.com/onsi/gomega from 1.9.0 to 1.10.0
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.9.0...v1.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-08 07:39:54 -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 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 4bb3c87228 Add kata containers support
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-27 06:54:25 -04:00
Daniel J Walsh 50135a792d Change references to libpod to engine
containers/common pkg/config is for more engines then just libpod.

We want to use the 'libpod' section to configure parts of buildah.  Renaming this
section to engine, makes it more obvious to users that these fields can effect other
container engines.

Certain fields are still libpod specific, so we do not change those fields.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-11 14:56:32 -04:00
Daniel J Walsh 357a5402c6 NewConfig(): passed-in configuration file should matter most
In NewConfig(), settings in the file whose name we're passed should
matter more than the hardwired default files, or the file named in the
CONTAINERS_CONF environment variable.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-09 17:29:26 -04:00
Qi Wang bec93b6703 Add pull_policy to LibpodConfig
pull_policy is the same as podman run --pull option to determin whether to pull a new image when running a container.
Accepted "always", "missing", and "never". Default value is "missing".

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-03-03 11:13:38 -05:00
Daniel J Walsh 3d6b785749 CgroupManager should belong to libpod not containers
CgroupManager is defined for managing containers, it is not defined
per container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-20 10:27:47 -05:00
Daniel J Walsh ad4b16c9d2 Remove additional_ adjective from containers.conf
Additional is implied, so should not be stated.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-19 09:48:11 -05:00
Daniel J Walsh 862583d397 Merge pull request #63 from ArangoGutierrez/issue_62
Add annotations into containers.conf file
2020-02-18 14:30:43 -05:00
Valentin Rothberg 130c712a05 pkg/capabilities
Replace pkg/caps with pkg/capabilities (from libpod).  It's also a fork
from Docker but attributes its origing with copyright notes and has a
trimmed down (and faster) API.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-18 15:58:19 +01:00
Carlos Eduardo Arango Gutierrez be1f3f6caa fix gofmt on file config_test.go
apply `gofmt -s -w config_test.go`

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-02-17 18:13:03 -05:00
Daniel J Walsh 4fa425fe38 Add Default function to read containers config
This function should be called to return a default config to be used
by callers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-10 08:21:07 -05:00
Daniel J Walsh 95fb926363 Stop validating networkconfig by default
This is causing issues in rootless and remote mode.  We should not be creating
directories on the fly.
Also stop exporting functions that are not used by Buildah and Podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-29 06:10:15 -05:00
Daniel J Walsh 789d9a515f Run code through codespell
Fix spelling mistakes found using codespell.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-08 08:56:50 -05:00
Daniel J Walsh 3e1c3932bf Add new Capability function to parse Capabiltiies
The Capability check handles merging of Default capabiltiies along
with user specified add and drop capabilities.

Fork docker/docker/oci/caps file to prevent a huge vendor

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-07 17:57:04 -05:00
Daniel J Walsh 2603f5de14 Fix handling of SELinux labeling
Also re-add DefaultMountsFile since we need a holding place to be
used in libpod.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-04 05:45:17 -05:00
Daniel J Walsh 74d7f91c66 Update/Fix man page and fix several bugs in definition.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-03 13:57:01 -05:00
Daniel J Walsh 67213c41a3 Remove merge code and optional handling
Fix handling of toml files

No longer need merge, since we can specify a default conf for each toml file.
The toml code will retain the previous defaults and only use the newly specified
values.

This greatly simplifies the code.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-12-11 08:26:52 -05:00
Qi Wang 894913abdf add libpod.conf to containers.conf
Add configurations from libpod.conf to containers.conf.Use merge code from libpod to read and merge configurations from file.

Add unshare_linux for build linux: HomeDir should buildah not only for linux. so add unshare_linux for linux and unshare.go for other

convert bool to optinalbool:Use OptionalBool for on-disk configurations so we can distinguish field is undefined  vs. user set to false.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-12-06 15:55:47 -05:00
Qi Wang 023822b7b0 turn off the check of the hook directory
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-11-09 13:05:58 -05:00
Qi Wang 64705d1f72 Fix tests failure #11
tests failures should be fixed since #11 add hooksdir to default config.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-11-04 10:28:56 -05:00
Qi Wang 9bb8e7e62b Add config package for containers.conf
This PR adds a package config for reading configurations from the containers.conf into the go struct.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-10-07 13:38:17 -04:00