diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-06-16 17:32:01 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-06-16 17:32:01 -0400 |
commit | c51c593ff630719d9d897319a7afabf412580d68 (patch) | |
tree | e1f8340019cf1e43581a73c6885fce4d1c5aaaa8 /pkg/specgen/generate/container_create.go | |
parent | d6965da26d194c7edfef65985d4a2c7b564a3fca (diff) | |
download | podman-c51c593ff630719d9d897319a7afabf412580d68.tar.gz podman-c51c593ff630719d9d897319a7afabf412580d68.tar.bz2 podman-c51c593ff630719d9d897319a7afabf412580d68.zip |
Re-add resource limit warnings to Specgen
These were part of Podman v1.9, but were lost in the transition
to using Specgen to create containers. Most resource limits are
checked via the sysinfo package to ensure they are safe to use
(the cgroup is mounted, kernel support is present, etc) and
removed if not safe. Further, bounds checks are performed to
ensure that values are valid.
Ensure these warnings are printed client-side when they occur.
This part is a little bit gross, as it happens in pkg/infra and
not cmd/podman, which is largely down to how we implemented
`podman run` - all the work is done in pkg/infra and it returns
only once the container has exited, and we need warnings to print
*before* the container runs. The solution here, while inelegant,
avoid the need to extensively refactor our handling of run.
Should fix blkio-limit warnings that were identified by the FCOS
test suite.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/specgen/generate/container_create.go')
-rw-r--r-- | pkg/specgen/generate/container_create.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go index 33075b543..869601e93 100644 --- a/pkg/specgen/generate/container_create.go +++ b/pkg/specgen/generate/container_create.go @@ -16,7 +16,9 @@ import ( "github.com/sirupsen/logrus" ) -// MakeContainer creates a container based on the SpecGenerator +// MakeContainer creates a container based on the SpecGenerator. +// Returns the created, container and any warnings resulting from creating the +// container, or an error. func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGenerator) (*libpod.Container, error) { rtc, err := rt.GetConfig() if err != nil { |