Commit Graph

3179 Commits

Author SHA1 Message Date
openshift-merge-bot[bot] ce424557dd Merge pull request #1781 from alexandear/fix-typos-across-repo
Fix typos across repo; extend codespell config
2024-01-04 11:12:20 +00:00
openshift-merge-bot[bot] a7a84a2399 Merge pull request #1780 from alexandear/remove-outdated-build-constraints
chore: delete obsolete // +build lines
2024-01-04 11:06:48 +00:00
Oleksandr Redko 3cc2a76ae9 Fix typos across repo; extend codespell config
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-03 23:38:47 +02:00
Oleksandr Redko ba4c7c98bb chore: remove outdated build constraints
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-03 22:56:00 +02:00
openshift-merge-bot[bot] 58e0c26e20 Merge pull request #1779 from rhatdan/VENDOR
Move minimal golang to v1.20
2024-01-03 19:36:54 +00:00
Daniel J Walsh e1ec41455a Move minimal golang to v1.20
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-03 11:55:35 -05:00
openshift-merge-bot[bot] f0f10d4bf9 Merge pull request #1775 from sohankunkerkar/add-timezone-helper-fns
pkg/timezone: add helper function to configure timezone for pod/containers
2024-01-03 16:16:12 +00:00
Sohan Kunkerkar eb78904f1e pkg/timezone: add helper function to configure timezone for pods/containers
This PR consolidates common functionality used by CRI-O and Podman
in one central location. I aimed to keep this change more generic,
considering that CRI-O and Podman have different ways for the file
mounting and applying security labels.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2024-01-03 09:03:03 -05:00
openshift-merge-bot[bot] f8d8190246 Merge pull request #1778 from containers/renovate/github.com-opencontainers-runc-1.x
fix(deps): update module github.com/opencontainers/runc to v1.1.11
2024-01-02 15:19:58 +00:00
renovate[bot] ce3e94b58f fix(deps): update module github.com/opencontainers/runc to v1.1.11
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-02 12:08:26 +00:00
openshift-merge-bot[bot] d927b4c4a6 Merge pull request #1777 from containers/renovate/github.com-containers-storage-digest
fix(deps): update github.com/containers/storage digest to 1020ab6
2024-01-02 12:07:29 +00:00
renovate[bot] 1b2963d627 fix(deps): update github.com/containers/storage digest to 1020ab6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-02 08:11:49 +00:00
openshift-merge-bot[bot] 3400eb39d5 Merge pull request #1776 from containers/renovate/github.com-containers-image-v5-digest
fix(deps): update github.com/containers/image/v5 digest to 1b221d4
2024-01-02 08:10:59 +00:00
renovate[bot] a10ef86dd9 fix(deps): update github.com/containers/image/v5 digest to 1b221d4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-01 01:45:53 +00:00
openshift-merge-bot[bot] 64b69126bd Merge pull request #1774 from saschagrunert/tzdir-lookup
Use `TZDIR` as override lookup path
2023-12-21 15:25:18 +00:00
Sascha Grunert 2b1bbe12b2 Use `TZDIR` as override lookup path
The TZDIR environment variable override the lookup paths and does not
append them. This patch fixes that behavior and is a follow-up on:

https://github.com/containers/common/pull/1772

Ref: https://github.com/containers/podman/pull/21063#discussion_r1432809463

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-12-21 09:15:17 +01:00
openshift-merge-bot[bot] 64aeafa759 Merge pull request #1773 from giuseppe/seccomp-allow-fchmodat2
seccomp: allow fchmodat2
2023-12-21 01:37:29 +00:00
Giuseppe Scrivano 850e306b5b seccomp: allow fchmodat2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-12-20 21:12:50 +01:00
openshift-merge-bot[bot] 64558e2c68 Merge pull request #1772 from saschagrunert/tzdir
Allow searching `$TZDIR` for timezone data
2023-12-20 16:00:07 +00:00
openshift-merge-bot[bot] e7c302a395 Merge pull request #1771 from containers/renovate/go-golang.org/x/crypto-vulnerability
fix(deps): update module golang.org/x/crypto to v0.17.0 [security]
2023-12-20 11:19:33 +00:00
Sascha Grunert 3364dc90a2 Allow searching `$TZDIR` for timezone data
glibc supports the environment variable as additional search path. We
now add this to the config validation to allow runtimes to search that
path as well.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-12-20 09:40:10 +01:00
renovate[bot] c04fc330e0 fix(deps): update module golang.org/x/crypto to v0.17.0 [security]
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-19 00:07:31 +00:00
openshift-merge-bot[bot] abf5ac33dd Merge pull request #1768 from containers/renovate/major-ci-vm-image
chore(deps): update dependency containers/automation_images to v20231208
2023-12-12 16:18:00 +00:00
renovate[bot] c393f5d136 chore(deps): update dependency containers/automation_images to v20231208
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-12 15:42:06 +00:00
openshift-merge-bot[bot] 107054a3a7 Merge pull request #1766 from containers/renovate/github.com-containerd-containerd-1.x
fix(deps): update module github.com/containerd/containerd to v1.7.11
2023-12-11 11:17:01 +00:00
renovate[bot] fff85bd729 fix(deps): update module github.com/containerd/containerd to v1.7.11
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-09 01:55:31 +00:00
openshift-merge-bot[bot] b745e63753 Merge pull request #1764 from containers/renovate/actions-setup-go-5.x
[skip-ci] Update actions/setup-go action to v5
2023-12-06 15:43:50 +00:00
renovate[bot] 651cc06b65 [skip-ci] Update actions/setup-go action to v5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-06 15:27:42 +00:00
openshift-merge-bot[bot] 2aa767d3b1 Merge pull request #1763 from Luap99/0.58-dev
bump to 0.58.0-dev
2023-12-06 15:27:26 +00:00
Paul Holzinger fb50dbb566 bump to 0.58.0-dev
This version is intended for podman 5.0.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-06 15:11:02 +01:00
openshift-merge-bot[bot] 5d4ad3114b Merge pull request #1761 from Luap99/rootlessnetns
libnetwork: add rootlessnetns package
2023-12-06 13:51:04 +00:00
Paul Holzinger c3566f4335 pkg/netns: make it cross compile
Just add stubs so podman can still compile.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 16:29:18 +01:00
Paul Holzinger 8fcacc1e9e libnetwork/rootlessnetns: build on freebsd
The cni code is used by freebsd so this package must build for it as
well. Given the logic is linux specific and not called by freebsd just
return an error.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 15:56:29 +01:00
Paul Holzinger 9ebf5859ff libnetwork/{netavark,cni}: accept containers.conf
Just pass down the full containers.conf as this is needed by
rootlessnetns code, also remove the now duplicated fields and read the
options directly from the config struct.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 15:28:20 +01:00
Paul Holzinger 2f7989c145 rootlessnetns: cleanup netns on setup error
Make sure we correctly cleanup the netns if there was an error and the
netns was just created. Also make sure the parent dir for the netns is
always created because a previous cleanup() may have it deleted.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 15:28:20 +01:00
Paul Holzinger 27584f37d9 libnetwork/{netavark,cni}: add iptables to $PATH
The old rootlessnetns logic overwrote PATH for the current process to
make sure /usr/sbin (where iptables is normally installed) is in $PATH.

Now instead of adding it for the current process we can just always set
it for the cni/iptables exec only.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 15:28:20 +01:00
Paul Holzinger 8b81a2471f add new pkg/systemd to contain podman systemd cgroup code
In podman we have code to move a process into a new systemd cgroup. This
code lived in the podman utils package. Because the new rootlessnetns
must call into that move this code to c/common.

Instead of dumping this again into a "util" package create a systemd
package which should have a better name. Also move the cgroup code
directly into pkg/cgroup. I am sure we can do some cleanup there in a
followup to prevent duplication.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 15:28:19 +01:00
Paul Holzinger 45b61c15d1 libnetwork/cni: integrate rootlessnetns
Call directly into the rootlessnetns code.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 14:06:25 +01:00
Paul Holzinger c25a9fa203 pkg/netns: unmount all paths excpet /proc/...
With the new NewNSAtPath function it is possible to create netns files
outside the normal netns directory. We need to make sure they can get
unmounted as well. We can check the the path is not under /proc.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 14:06:25 +01:00
Paul Holzinger 5ad7dddf8d libnetwork/netavark: integrate rootlessnetns
Integrate the new rootlessnetns package into netavark. This means when
this is vendored into podman we need to drop the rootless netns code
there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 14:06:25 +01:00
Paul Holzinger d8e8a9947b libnetwork: add rootlessnetns package
Add a new rootlessnetns package based on the rootless netns code from
podman. It however makes some significant changes:
 - First it uses a directory in the runroot and not tmpdir.
 - The netns mount is stored in the directoy and not the global netns
   runtime dir to prevent name collisions. The old code used the sha256
   to do that.
 - The teardown and setup logic has been made more robust and now used a
   reference counter to keep track on when to cleanup. The podman
   cleanup logic was racy and tied to running podman containers. Given
   the plan to allow buildah to use this as well we need this.
 - There is no lock for this code, the goal is to have this called
   through the network interface which is already locked so there is no
   need for another lock here.

Future work:
 - add pasta support
 - add port forwarding logic here

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 14:06:20 +01:00
Paul Holzinger c926f5a84e pkg/netns: add NewNSAtPath()
Add new function to create a netns bind mounted to a specific path. This
is useful for the new rootless netns logic were I intend to mount the
netns at a different directory to avoid naming conflicts.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 11:22:22 +01:00
Paul Holzinger 87e03bcad1 pkg/netns: handle error better
Logging the error and returning it makes no sense, instead add the
context to the error before returning it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 11:22:22 +01:00
Paul Holzinger 1aeaf45fce pkg/netns: remove unused origNS
We never use the origNS other than closing it again so we can just
remove this code as it does nothing useful.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 11:22:22 +01:00
Paul Holzinger 4914fe746d pkg/netns: use /proc/thread-self link
This link was added in kernel 3.17 so it should be safe to use now as we
do not support running on such old kernels anyway.

This makes the code a bit simpler and safes two syscalls.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 11:22:21 +01:00
openshift-merge-bot[bot] 541125e031 Merge pull request #1760 from containers/renovate/github.com-containernetworking-plugins-1.x
fix(deps): update module github.com/containernetworking/plugins to v1.4.0
2023-12-05 10:12:40 +00:00
renovate[bot] 830f57011c fix(deps): update module github.com/containernetworking/plugins to v1.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-04 18:30:15 +00:00
openshift-merge-bot[bot] 1b45ca4b5f Merge pull request #1758 from ygalblum/check-report-writer
Image copier: make sure ReportWriter is not nil before accessing
2023-12-04 12:49:12 +00:00
Ygal Blum a525f15fc3 Image copier: make sure ReportWriter is not nil before accessing
When running in Quiet mode, the ReportWriter can be nil causing a crash

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-12-04 14:34:40 +02:00
openshift-merge-bot[bot] b89e527ab7 Merge pull request #1756 from containers/renovate/github.com-containerd-containerd-1.x
fix(deps): update module github.com/containerd/containerd to v1.7.10
2023-11-30 09:27:20 +00:00