Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't query stopped containers by default #611

Merged
merged 1 commit into from
May 14, 2024
Merged

Conversation

buchdag
Copy link
Member

@buchdag buchdag commented May 14, 2024

As remarked by @karlyan17 in #314, the configuration option -include-stopped has no effect because the inclusion of stopped containers was hard set to true internally.

Edit: the issue is actually a bit different.

The inclusion of stopped containers happen in two steps:

  1. first docker-gen either query the Docker API endpoint for all containers or only running containers
  2. this containers list is either filtered to keep only the running ones (default) or not filtered at all (-include-stopped)

The second step works correctly and probably always have.

The first step is the one having an issue : docker-gen always get all the containers from the Docker API endpoint even when -include-stopped is not used. This does not impact -include-stopped, but it means docker-gen always fetch more data than necessary from the Docker API endpoint when not using this feature.

Fix #314

@buchdag buchdag added the bug label May 14, 2024
@buchdag buchdag self-assigned this May 14, 2024
@buchdag buchdag merged commit 82bddc6 into main May 14, 2024
3 checks passed
@buchdag buchdag deleted the include-stopped branch May 14, 2024 22:23
@buchdag buchdag changed the title fix: don't include stopped containers by default fix: don't query stopped containers by default May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stopped containers are always included
1 participant