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

Issue-11374: Modified compose up command to respect COMPOSE_REMOVE_ORPHANS environment variable #11462

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

batcity
Copy link

@batcity batcity commented Feb 5, 2024

What I did:
Modified the up command to respect the COMPOSE_REMOVE_ORPHANS environment variable, It now picks up the default value for the remove orphans flag from the environment variable if the remove-orphans flag isn't provided via the CLI

Related issue:
Fixes #11374

How did I test my fix:

I created a test container using the docker compose command, then I modified the name of the service and reran the docker compose up command after including my changes

Here's the command I ran:

COMPOSE_REMOVE_ORPHANS=1 ./docker-compose up

It now respects the environment variable and deletes the orphaned containers

Screenshot 2024-02-06 at 12 40 50 AM

A picture of a cute animal, if possible in relation to what you did

image

@ndeloof ndeloof enabled auto-merge (rebase) February 6, 2024 08:12
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9b0e3d5) 58.27% compared to head (2679c02) 58.05%.
Report is 1 commits behind head on main.

❗ Current head 2679c02 differs from pull request most recent head e22dba3. Consider uploading reports for the commit e22dba3 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11462      +/-   ##
==========================================
- Coverage   58.27%   58.05%   -0.23%     
==========================================
  Files         134      136       +2     
  Lines       11546    11544       -2     
==========================================
- Hits         6729     6702      -27     
- Misses       4153     4181      +28     
+ Partials      664      661       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

auto-merge was automatically disabled February 6, 2024 19:28

Head branch was pushed to by a user without write access

@ndeloof
Copy link
Contributor

ndeloof commented Feb 8, 2024

Can you pleases rebase and squash your commits so we can merge ?

@batcity
Copy link
Author

batcity commented Feb 8, 2024

@ndeloof I've rebased and squashed my commits

@ndeloof ndeloof enabled auto-merge (rebase) February 8, 2024 20:51
@batcity
Copy link
Author

batcity commented Feb 9, 2024

@ndeloof FYI you've probably seen this already; a couple of these checks are failing ↓↓ but it seems to happen on other PRs too: #11473

auto-merge was automatically disabled February 17, 2024 00:33

Head branch was pushed to by a user without write access

@batcity batcity force-pushed the issue-11374-bugfix branch 7 times, most recently from cc32995 to d064726 Compare February 17, 2024 01:46
…PHANS environment variable

Signed-off-by: Gautham Hullikunte <46633282+batcity@users.noreply.github.com>
Signed-off-by: Gautham Hullikunte <gautham@Gauthams-MacBook-Pro.local>
@ndeloof ndeloof enabled auto-merge (rebase) February 17, 2024 07:30
@ndeloof ndeloof merged commit 6c17554 into docker:main Feb 17, 2024
23 of 26 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.

[BUG] COMPOSE_REMOVE_ORPHANS is not respected on the up command
2 participants