Skip to content

Conversation

@Tarow
Copy link
Contributor

@Tarow Tarow commented Mar 26, 2025

Description

If a podman container contains the string podman-, the activation will fail:

services.podman.containers."podman-exporter" = {
  image = "quay.io/navidys/prometheus-podman-exporter:latest";
};

The generated ~/.config/podman/containers.manifest will only contain exporter and thus the non-existing container with that name is considered orphaned. Attempting to remove that container will fail:

Loading manifest from /home/niklas/.config/podman/containers.manifest...
Removing orphaned container: podman-exporter
Running: /nix/store/kixsa8zkgkgdhaaw94w97ibz4ljmajn7-podman-5.4.1/bin/podman container stop podman-exporter/nix/store/kixsa8zkgkgdhaaw94w97ibz4ljmajn7-podman-5.4.1/bin/podman container rm -f podman-exporter
Error: --filter takes no arguments
        Command failed: /nix/store/kixsa8zkgkgdhaaw94w97ibz4ljmajn7-podman-5.4.1/bin/podman container stop podman-exporter/nix/store/kixsa8zkgkgdhaaw94w97ibz4ljmajn7-podman-5.4.1/bin/podman container rm -f podman-exporter
Error: container is an invalid filter

The PR should only remove the generated podman- prefix for the manifest file, not other occurrences of the podman- string inside the container name.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all
    or nix build --reference-lock-file flake.lock ./tests#test-all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@n-hass @bamhm182

Only remove the "podman-" prefix and retain other occupances.
Fixes activation script which fails if container name includes "podman-"
string due to mismatch in the generated manifest.
Copy link
Contributor

@n-hass n-hass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. lgtm

@khaneliman khaneliman merged commit 7170300 into nix-community:master Mar 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants