Skip to content

Commit

Permalink
podman-container: fix tests and failing podman 5.3.0 service
Browse files Browse the repository at this point in the history
Co-authored-by: Dylan Wilson <dylan@bytepen.com>
  • Loading branch information
GaetanLepage and bamhm182 authored Dec 2, 2024
1 parent d2e2bda commit 873e39d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
7 changes: 7 additions & 0 deletions modules/services/podman-linux/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,12 @@ in {
Install = { WantedBy = [ "timers.target" ]; };
};
})
({
xdg.configFile."systemd/user/podman-user-wait-network-online.service.d/50-exec-search-path.conf".text =
''
[Service]
ExecSearchPath=${pkgs.bashInteractive}/bin:${pkgs.systemd}/bin:/bin
'';
})
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ Delegate=yes
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name=my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network=mynet --network-alias test-alias-1 --network-alias test-alias-2 --sdnotify=conmon -d --device=/dev/null:/dev/null --entrypoint=/sleep.sh --read-only-tmpfs -v /tmp:/tmp --label io.containers.autoupdate=registry --publish 8080:80 --env VAL_A=A --env VAL_B=2 --env VAL_C=false --label nix.home-manager.managed=true --security-opt=no-new-privileges docker.io/alpine:latest
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --entrypoint /sleep.sh --network-alias test-alias-1 --network-alias test-alias-2 --read-only-tmpfs --network mynet --sdnotify=conmon -d --device /dev/null:/dev/null -v /tmp:/tmp --label io.containers.autoupdate=registry --publish 8080:80 --env VAL_A=A --env VAL_B=2 --env VAL_C=false --label nix.home-manager.managed=true --security-opt=no-new-privileges docker.io/alpine:latest

[Unit]
Wants=network-online.target
After=network-online.target
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
After=network.target
Before=fake.target
Description=home-manager test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Delegate=yes
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name=my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network=my-net --network=externalnet --sdnotify=conmon -d --label nix.home-manager.managed=true docker.io/alpine:latest
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network my-net --network externalnet --sdnotify=conmon -d --label nix.home-manager.managed=true docker.io/alpine:latest

[Unit]
Wants=network-online.target
After=network-online.target
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
After=network.target
After=podman-my-net-network.service
Description=Service for container my-container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ Environment=PATH=/run/wrappers/bin:/usr/bin:/bin:/usr/sbin:/sbin:/nix/store/0000
ExecStartPre=/nix/store/00000000000000000000000000000000-await-podman-unshare
RemainAfterExit=yes
TimeoutStartSec=15
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet=192.168.123.0/24 --gateway=192.168.123.1 --label nix.home-manager.managed=true my-net
Type=oneshot
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet 192.168.123.0/24 --gateway 192.168.123.1 --label nix.home-manager.managed=true my-net
SyslogIdentifier=%N
Type=oneshot

[Unit]
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
After=network.target
Description=Service for network my-net
SourcePath=/nix/store/00000000000000000000000000000000-home-network-podman-my-net/quadlets/podman-my-net.network
RequiresMountsFor=%t/containers
7 changes: 5 additions & 2 deletions tests/modules/services/podman-linux/network-expected.service
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ Environment=PATH=/run/wrappers/bin:/usr/bin:/bin:/usr/sbin:/sbin:/nix/store/0000
ExecStartPre=/nix/store/00000000000000000000000000000000-await-podman-unshare
RemainAfterExit=yes
TimeoutStartSec=15
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet=192.168.1.0/24 --gateway=192.168.1.1 --opt isolate=true --label nix.home-manager.managed=true --ipam-driver dhcp --dns=192.168.55.1 --log-level=debug my-net
Type=oneshot
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet 192.168.1.0/24 --gateway 192.168.1.1 --opt isolate=true --label nix.home-manager.managed=true --ipam-driver dhcp --dns=192.168.55.1 --log-level=debug my-net
SyslogIdentifier=%N
Type=oneshot

[Unit]
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
After=network.target
Description=Service for network my-net
SourcePath=/nix/store/00000000000000000000000000000000-home-network-podman-my-net/quadlets/podman-my-net.network
RequiresMountsFor=%t/containers

0 comments on commit 873e39d

Please sign in to comment.