Skip to content

CLI inappropriately suggests --file flag when --skip-services-check is needed #212

Description

@heyakyra

TL;DR: CLI suggests --name regardless of where the conflict occurs. For usability, it would be nice to get additional information like:

Use --skip-services-check if you plan to replace the existing service file at [PATH]

Attempting to create Quadlet files from existing objects, but file conflicts get in the way even when specifying the file location. This is confusing when the --file flag specifies a path that should not conflict, and the services check purpose isn't obvious from the output.

for container in $(sudo podman ps --format {{.Names}}); do
    sudo $(which podlet) --file . generate container $container
done

replacing that flag with --file /home/me/podlet (which should be the same as .) didn't make a difference, of course. Output includes (for nginx-proxy/acme-companion):

Error:
   0: File name `nginx-proxy` conflicts with existing unit file: /etc/systemd/system/container-nginx-proxy.service

Location:
   src/cli.rs:809

Suggestion: Change the generated file's name with `--file` or `--name`. Alternatively, use `--skip-services-check` if this is ok.

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Error:
   0: File name `nginx-proxy-acme` conflicts with existing unit file: /etc/systemd/system/container-nginx-proxy-acme.service

Location:
   src/cli.rs:809

Suggestion: Change the generated file's name with `--file` or `--name`. Alternatively, use `--skip-services-check` if this is ok.

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions