containers / podlet

Generate Podman Quadlet files from a Podman command, compose file, or existing object
https://crates.io/crates/podlet
Mozilla Public License 2.0
417 stars 12 forks source link

can't generate container file from running container with more than 1 network-aliases #98

Open mbuttenschoen opened 1 month ago

mbuttenschoen commented 1 month ago

command: podlet generate container jitsi-meet_prosody_1

result: Error: 0: error creating Quadlet file(s) from an existing object 1: error parsing Podman container command from ["/usr/bin/podman", "run", "--name=jitsi-meet_prosody_1", "--cidfile=/run/user/1001/jitsi-meet_prosody_1.cid", "--replace", "--rm", "--cgroups=split", "--network=jitsi-meet_meet.jitsi", "--network-alias", "prosody", "--network-alias", "xmpp.meet.jitsi", "--sdnotify=conmon", "-d", "-v", "/home/jitsi/jitsi-meet/.jitsi-meet-cfg/prosody/config:/config:Z", "-v", "/home/jitsi/jitsi-meet/.jitsi-meet-cfg/prosody/prosody-plugins-custom:/prosody-plugins-custom:Z", "--expose=5222", "--expose=5269", "--expose=5347", "--expose=5280", "--label", "PODMAN_SYSTEMD_UNIT=podman-compose@jitsi-meet.service", "--label", "com.docker.compose.container-number=1", "--label", "com.docker.compose.project=jitsi-meet", "--label", "com.docker.compose.project.config_files=docker-compose.yml", "--label", "com.docker.compose.project.working_dir=/home/jitsi/jitsi-meet", "--label", "com.docker.compose.service=prosody", "--label", "io.podman.compose.config-hash=98037726529e617f72c1e9193b3ae0c92e2b082674ae9ee7e90efd0e6508d48f", "--label", "io.podman.compose.project=jitsi-meet", "--label", "io.podman.compose.version=1.2.0", "--env-file", "/home/jitsi/jitsi-meet/.env", "jitsi/prosody:stable-9646"] 2: error: the argument '--network-alias ' cannot be used multiple times

2: Usage: podlet [OPTIONS] [COMMAND]...

  For more information, try '--help'.

2:

Location: src/cli/generate.rs:152

look here: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html NetworkAlias= Add a network-scoped alias for the container. This has the same format as the --network-alias option to podman run. Aliases can be used to group containers together in DNS resolution: for example, setting NetworkAlias=web on multiple containers will make a DNS query for web resolve to all the containers with that alias. This key can be listed multiple times.

best regards Michael

k9withabone commented 4 days ago

Will be fixed as part of #110.