Commit Graph

20 Commits

Author SHA1 Message Date
Giuseppe Scrivano 8daaf06155 config: do not set the default nproc to the max available
it is wrong for two reasons: 1) we set the current process limits from
a library, and 2) it sets a too high value for root, since it is the
maximum allowed value on the system.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-11 16:40:18 +02:00
Paul Holzinger 805e7ae406 update golangci-lint to 1.60.3
Contains fixes for new linters, removed depracted and removed linters
from the config.

Most notably because we use go 1.22 now we can get rid of the copy for
loop vars[1]. Also as of the go 1..2 we can use the new int range syntax
in for loops the new intrange linter checks that.

[1] https://go.dev/blog/loopvar-preview

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-03 15:57:02 +02:00
Valentin Rothberg 8e842b2ec9 linters: enable unconvert
Useful micro optimizations.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-01 11:23:18 +02:00
Brent Baude 764f36735e cleanup getDefaultMachineUser|Image
small refactoring for #1603 adn #1608 where we no longer have operating
system differences.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-11 07:46:17 -05:00
Valentin Rothberg 0ce0a1367c containers.conf: add new `compose_providers` option
Specify one or more external providers for the compose command.  The
first found provider is used for execution. Can be an absolute path or a
(file) name. Relative names are invalid.  File names are evaluated via
$PATH look ups.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-24 15:53:17 +02:00
Valentin Rothberg e17483b871 bump to golangci-lint v1.50.0
Used `go fmt` rules to migrate away from deprecated functions, for
instance `gofmt -w -s -r 'ioutil.TempDir(a, b) -> os.MkdirTemp(a, b)'`

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-17 15:03:07 +02:00
Arthur Sengileyev 30d0948da5 Adjust default volumes for windows compatibility
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-08-19 17:09:25 +03:00
Doug Rabson c4cbb913bd Change some defaults for FreeBSD and add a sample containers.conf
Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-05-09 14:07:58 +01:00
Paul Holzinger a2ee133248 Fix ImageCopyTmpDir for windows
We cannot use /var/tmp on windows, instead use the temp var which is
defined on windows, of fall back to appdata.

Fixes containers/podman#13434

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-08 19:40:10 +01:00
Paul Holzinger 4eb265ce95 remove rootless_networking field from containers.conf
This field was only needed for machine to force cni, however you can set
netns="bridge" in the config to have the same effect. This is already
done in the machine setup.

The field was more of a hack and just creates confusion for users so we
remove it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-20 16:23:12 +01:00
Jason T. Greene d813c5e6fb Add platform driven image and user defaults for podman machine
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2021-12-09 14:37:54 -06:00
Matthew Heon 92ebb4a858 Switch default Rootless Networking to "CNI" for OSX
This should better support rootless CNI usescases.

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

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-09-01 15:57:00 -04:00
Sascha Grunert 0141e99d65 Fix nested elseif
The nested elseif `else {if cond {}}` can be replaced with `else if cond
{}`.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-25 11:31:53 +02: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 b5b50e7035 Fix compiling on 32 bit machines
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-18 15:12:47 -04:00
Daniel J Walsh aaaac87784 Don't up the default number of open files, just processes.
Python call to Popen attempt to close all open file descriptors by looking at
the maximum number of open file descripors defined in ulimits.  If we set
this to a huge number by default Popen will run much slower since it will
attempt to close the total number of FDs one by one.

We should just use the default that the calling process had unless the user
overrides the default in containers.conf.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-05 10:46:28 -05:00
Daniel J Walsh 46d6f01773 Merge pull request #52 from rhatdan/version
Setup default ulimits to nproc & nofile of current process
2020-02-04 07:02:06 -05:00
Sascha Grunert 38c952b22d Fix 32bit build by using unix.CGROUP2_SUPER_MAGIC
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-04 11:30:40 +01:00
Daniel J Walsh 8241546743 Setup default ulimits to nproc & nofile of current process
In root running containers we want to approach the MAX  Number of processes and
open files, so that services running Podman will work when they have lots of open
files or processes.  In rootless containers this number can not be changed.  This
patch will only increase the numbers if the process is allowed.

Docker set the limit to 2**20 (1048576), it looks like this was the max for RHEL5 OS.
So we fall back to attempt to set this limit if the MAC_PROC limit is not allowed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-03 13:50:28 -05:00
Daniel J Walsh b3d6ec550e Fix definitions for cross compilers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-16 16:58:38 -05:00